All of lore.kernel.org
 help / color / mirror / Atom feed
* Linus 2.6.29-rc4
@ 2009-02-08 21:01 Linus Torvalds
  2009-02-09  1:21 ` Arjan van de Ven
                   ` (3 more replies)
  0 siblings, 4 replies; 50+ messages in thread
From: Linus Torvalds @ 2009-02-08 21:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List


Another week (and a half), another -rc.

Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
updates, FS updates (ubifs, btrfs), you name it. It's all there.

But more importantly, people really have been working on regressions, and 
hopefully this closes a nice set of the top one, and hopefully without 
introducing too many new ones.

			Linus

---
Aaro Koskinen (1):
      ARM: OMAP: gptimer min_delta_ns corrected

Adrian Hunter (5):
      UBIFS: ensure orphan area head is initialized
      UBIFS: fix LPT out-of-space bug (again)
      UBIFS: sync wbufs after syncing inodes and pages
      UBIFS: spelling fix 'date' -> 'data'
      UBIFS: remount ro fixes

Al Viro (1):
      braino in sg_ioctl_trans()

Alberto Bertogli (3):
      Fix small typo in bio.h's documentation
      Fix misleading comment in bio.h
      bio.h: If they MUST be inlined, then use __always_inline

Alex Buell (1):
      fbdev: incorrect URL given in drivers/video/Kconfig

Alex Chiang (1):
      PCI: properly clean up ASPM link state on device remove

Alexander Beregalov (1):
      sata_sil: Fix build breakage

Alexander Duyck (3):
      igb: Fix DCA errors and do not use context index for 82576
      igb: prevent skb_over panic w/ mtu smaller than 1K
      igb: fix link reporting when using sgmii

Alexey Dobriyan (3):
      sky2: fix hard hang with netconsoling and iface going up
      alpha: fixup BUG macro
      seq_file: fix big-enough lseek() + read()

Alexey Klimov (1):
      V4L/DVB (10317): radio-mr800: fix radio->muted and radio->stereo

Andre Noll (1):
      md: Fix a bug in linear.c causing which_dev() to return the wrong device.

Andrea Righi (1):
      fbmem: don't call copy_from/to_user() with mutex held

Andreas Schwab (1):
      x86 setup: fix asm constraints in vesa_store_edid

Andrew Morton (4):
      drivers/gpu/drm/i915/intel_lvds.c: fix locking snafu
      kernel/async.c: fix printk warnings
      revert "rlimit: permit setting RLIMIT_NOFILE to RLIM_INFINITY"
      hp-wmi: fix error path in hp_wmi_bios_setup()

Andy Fleming (2):
      gianfar: Fix BD_LENGTH_MASK definition
      gianfar: Fix potential soft reset race

Andy Walls (3):
      V4L/DVB (10218): cx23885: Fix Oops for mixed install of analog and digital only cards
      V4L/DVB (10219): saa7134: Prevent Oops due to stale IRQ status when enabling interrupts
      V4L/DVB (10229): cx88-dvb: Fix order of frontend allocations

Anton Vorontsov (1):
      gianfar: Fix Wake-on-LAN support

Antti Palosaari (2):
      V4L/DVB (10287): af9015: fix second FE
      V4L/DVB (10288): af9015: bug fix: stick does not work always when plugged

Arjan van de Ven (1):
      ahci: add a module parameter to ignore the SSS flags for async scanning

Artem Bityutskiy (20):
      UBI: improve ioctl commentaries
      UBI: remove unnecessry header inclusion
      UBI: allow all ioctls
      UBIFS: do not commit twice
      UBIFS: constify operations
      UBI: add ioctl compatibility
      UBI: use nicer 64-bit math
      UBIFS: do not treat all data as short term
      UBIFS: document dark_wm and dead_wm better
      UBI: remove unused variable
      UBI: fix resource de-allocation
      UBIFS: simplify locking
      UBIFS: fix LEB list freeing
      UBIFS: add re-mount debugging checks
      UBIFS: always clean up GC LEB space
      UBIFS: fix assertions
      UBIFS: fix no_chk_data_crc
      UBIFS: return sensible error codes
      UBIFS: remove fast unmounting
      write-back: fix nr_to_write counter

Arve Hjønnevåg (3):
      Staging: android: binder: fix arm build errors
      Staging: android: timed_gpio: Fix build to build on kernels after 2.6.25.
      Staging: android: Add lowmemorykiller documentation.

Atsushi Nemoto (2):
      MIPS: TXx9: Add support for TX4939 internal RTC
      tx4939ide: typo fix and minor cleanup

Atsushi SAKAI (1):
      lguest: typos fix

Balaji Rao (1):
      mfd: Remove non exported references from pcf50633

Bartlomiej Zolnierkiewicz (4):
      block: export SSD/non-rotational queue flag through sysfs
      ide: fix ide_register_port() failure handling
      ide: add CS5536 host driver (v3)
      icside: fix PCB version 6 support (v2)

Ben Hutchings (5):
      sfc: SFN4111T: Fix GPIO sharing between I2C and FLASH_CFG_1
      sfc: Update board info for hardware monitor on SFN4111T-R5 and later
      sfc: SFT9001: Always enable XNP exchange on SFT9001 rev B
      sfc: SFX7101/SFT9001: Fix AN advertisements
      sfc: Replace stats_enabled flag with a disable count

Benjamin Herrenschmidt (4):
      powerpc: Fix oops on some machines due to incorrect pr_debug()
      atyfb: Properly save PCI state before changing PCI PM level
      aty128fb: Properly save PCI state before changing PCI PM level
      radeonfb: Fix resume from D3Cold on some platforms

Benjamin Zores (1):
      ipv4: fix infinite retry loop in IP-Config

Bernd Schmidt (1):
      Blackfin arch: fix bug - traps test case 19 for exception 0x2d fails

Bharath Ramesh (1):
      hwmon: applesmc: add support for MacPro 3 temperature sensors

Bill Nottingham (1):
      Documentation/Changes: add required versions for new filesystems

Boaz Harrosh (1):
      include/linux: Add bsg.h to the Kernel exported headers

Bob Copeland (1):
      ath5k: fix locking in ath5k_config

Borislav Petkov (2):
      ide-cd: fix DMA for non bio-backed requests
      x86: APIC: enable workaround on AMD Fam10h CPUs

Bryan Wu (1):
      Blackfin arch: Add ANOMALY_05000380 to BF54x to kill the compile warning

Carmelo AMOROSO (1):
      sh: fcnvds fix with denormalized numbers on SH-4 FPU.

Carsten Otte (1):
      do_wp_page: fix regression with execute in place

Chris Ball (1):
      Btrfs: Handle SGID bit when creating inodes Before this patch, new files/dirs would ignore the SGID bit on their parent directory and always be owned by the creating user's uid/gid.

Chris Mason (18):
      Btrfs: stop providing a bmap operation to avoid swapfile corruptions
      Btrfs: do less aggressive btree readahead
      Btrfs: fix readdir on 32 bit machines
      Btrfs: Catch missed bios in the async bio submission thread
      Btrfs: async threads should try harder to find work
      Btrfs: sort references by byte number during btrfs_inc_ref
      Btrfs: disable leak debugging checks in extent_io.c
      Btrfs: hash_lock is no longer needed
      Btrfs: Change btree locking to use explicit blocking points
      Btrfs: Make btrfs_drop_snapshot work in larger and more efficient chunks
      Btrfs: Don't try to compress pages past i_size
      Btrfs: Change btrfs_truncate_inode_items to stop when it hits the inode
      Btrfs: change btrfs_del_leaf to drop locks earlier
      Btrfs: fix btrfs_unlock_up_safe to walk the entire path
      Btrfs: Only prep for btree deletion balances when nodes are mostly empty
      Btrfs: don't return congestion in write_cache_pages as often
      Btrfs: Fix memory leak in cache_drop_leaf_ref
      Btrfs: Make sure dir is non-null before doing S_ISGID checks

Christian Hesse (1):
      Btrfs: make btrfs acls selectable This patch adds a menu entry to kconfig to enable acls for btrfs. This allows you to enable FS_POSIX_ACL at kernel compile time.

Christopher SMITH (1):
      sh: Only reserve memory under CONFIG_ZERO_PAGE_OFFSET when it != 0.

Clemens Ladisch (1):
      sound: usb-audio: handle wMaxPacketSize for FIXED_ENDPOINT devices

Cliff Brake (2):
      pxamci: replace #ifdef CONFIG_PXA27x with if (cpu_is_pxa27x())
      pxamci: enable DMA for write ops after CMD/RESP

Cord Walter (1):
      pcnet_cs: Fix misuse of the equality operator.

Corentin Chary (10):
      UBI: add ioctl for map operation
      UBI: add ioctl for unmap operation
      UBI: add ioctl for is_mapped operation
      eeepc-laptop: split eeepc_backlight_exit()
      asus_acpi: Add R1F support
      asus-laptop: use generic netlink interface
      asus-laptop: hotkeys via the generic input interface
      asus-laptop: update Kconfig for input layer
      asus-laptop: fix label indentation
      eeepc-laptop: use netlink interface

Cornelia Huck (4):
      async: Fix running list handling.
      async: Handle kthread_run() return codes.
      async: Add some documentation.
      async: Rename _special -> _domain for clarity.

Daisuke Nishimura (1):
      memcg: get/put parents at create/free

Dan Carpenter (2):
      fix emacs indenting howto filename expansion
      sx.c: fix missed unlock_kernel() on error path in sx_fw_ioctl()

Daniel Marjamäki (1):
      netxen: fix memory leak in drivers/net/netxen_nic_init.c

Darren Salt (1):
      eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init

Darrick J. Wong (1):
      PCI hotplug: fakephp: Allocate PCI resources before adding the device

Dave Chinner (1):
      xfs: Check buffer lengths in log recovery

Dave Jones (2):
      ipv6: compile fix for ip6mr.c
      x86: add cache descriptors for Intel Core i7

Dave Kleikamp (1):
      vfs: Don't call attach_nobh_buffers() with an empty list

David Altobelli (2):
      hpilo: increment version
      hpilo: open/close fix

David Brownell (1):
      rtc: rtc-dm355evm driver

David Daney (3):
      MIPS: Fix a typo in watchpoint register structure.
      MIPS: Read watch registers with interrupts disabled.
      MIPS: Use hardware watchpoints on all R1 and R2 CPUs.

David Howells (1):
      CRED: Fix SUID exec regression

David Rientjes (1):
      slub: fix per cpu kmem_cache_cpu array memory leak

David S. Miller (10):
      ipv6: Make mc_forwarding sysctl read-only.
      sparc64: Move generic PCR support code to seperate file.
      sparc: Probe PMU type and record in sparc_pmu_type.
      tun: Add some missing TUN compat ioctl translations.
      sparc64: Implement NMI watchdog on capable cpus.
      net: Fix userland breakage wrt. linux/if_tunnel.h
      sparc64: On non-Niagara, need to touch NMI watchdog in NOHZ mode.
      sparc64: Validate kernel generated fault addresses on sparc64.
      sparc64: Kill bogus TPC/address truncation during 32-bit faults.
      Revert "tcp: Always set urgent pointer if it's beyond snd_nxt"

David Vrabel (4):
      uwb: safely remove all reservations
      wusb: return -ENOTCONN when resetting a port with no connected device
      wusb: timeout when waiting for ASL/PZL updates in whci-hcd
      uwb: lock rc->rsvs_lock with spin_lock_bh()

Davide Libenzi (1):
      epoll: drop max_user_instances and rely only on max_user_watches

Dean Nelson (2):
      sgi-xp: link XPNET's net_device_ops to its net_device structure
      sgi-xp: fix writing past the end of kzalloc()'d space

Devin Heitmueller (2):
      V4L/DVB (10261): em28xx: fix kernel panic on audio shutdown
      V4L/DVB (10411): s5h1409: Perform s5h1409 soft reset after tuning

Dhananjay Phadke (1):
      netxen: revert jumbo ringsize

Dimitris Michailidis (1):
      tcp: Fix length tcp_splice_data_recv passes to skb_splice_bits.

Divy Le Ray (1):
      cxgb3: Fix lro switch

Divyesh Shah (1):
      cfq-iosched: Allow RT requests to pre-empt ongoing BE timeslice

Ed Swierk (1):
      signals, debug: fix BUG: using smp_processor_id() in preemptible code in print_fatal_signal()

Eero Nurkkala (1):
      OMAP: ASoC: Fix spinlock misuse in omap-pcm.c

Eric Biederman (1):
      seq_file: move traverse so it can be used from seq_read

Eric Dumazet (4):
      udp: optimize bind(0) if many ports are in use
      net: wrong test in inet_ehash_locks_alloc()
      udp: increments sk_drops in __udp_queue_rcv_skb()
      modules: Use a better scheme for refcounting

Eric Piel (1):
      lis3lv02d: add axes knowledge for HP 6530

Eric Sandeen (1):
      don't reallocate sxp variable passed into xfs_swapext

Evgeniy Polyakov (1):
      mm: OOM documentation update

Felix Blyakher (1):
      [XFS] Warn on transaction in flight on read-only remount

Filip Aben (1):
      hso: add new device id's

Frank Seidel (1):
      ACPI: add missing KERN_* constants to printks

Frans Pop (2):
      hp-wmi: fix regressions caused by missing if statement
      hp-wmi: set initial docking state

Frederic Weisbecker (2):
      tracing/function-graph-tracer: fix a regression while suspend to disk
      hrtimers: increase clock min delta threshold while interrupt hanging

Geert Uytterhoeven (1):
      staging: agnx: drivers/staging/agnx/agnx.h needs <linux/io.h>

Gerhard Pircher (1):
      ide: Force VIA IDE legacy interrupts for AmigaOne boards

Grace Pan (1):
      Blackfin arch: Add in cflag to support mlong-calls for kgdb_test

Graf Yang (3):
      Blackfin arch: Fix bug - BF518 port F, G, and H have different mux offset compare to BF527
      Blackfin arch: Fix bug - 561 SMP kernel can't boot from jffs2
      Blackfin arch: add platform device bfin_mii-bus and KSZ8893M switch driver platform resources to board files

Grant Likely (3):
      powerpc/5200: update defconfigs
      powerpc/5200: Bugfix for PCI mapping of memory and IMMR
      powerpc/5200: update device tree binding documentation

Greg Kroah-Hartman (3):
      Staging: comedi: fix Kbuild
      Staging: meilhaus: fix Kbuild
      Staging: android: fix build error on 64bit boxes

H. Peter Anvin (2):
      x86: correct the CPUID pattern for MSR_IA32_MISC_ENABLE availability
      x86: add x86@kernel.org to MAINTAINERS

Haiying Wang (1):
      ucc_geth: Change uec phy id to the same format as gianfar's

Hans J. Koch (1):
      UIO: Add missing documentation of features added recently

Hans Verkuil (8):
      V4L/DVB (10214): Fix 'stb0899_get_srate' defined but not used warning
      V4L/DVB (10230): v4l2-device: fix buggy macro
      V4L/DVB (10243): em28xx: fix compile warning
      V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings.
      V4L/DVB (10250): cx25840: fix regression: fw not loaded on first use
      V4L/DVB (10270): saa7146: fix unbalanced mutex_lock/unlock
      V4L/DVB (10314): cx25840: ignore TUNER_SET_CONFIG in the command callback.
      V4L/DVB (10229): ivtv: fix memory leak

Hans-Christian Egtvedt (1):
      atmel-ssc: fix misuse of dev_dbg when requested ssc instance is not found

Herbert Xu (3):
      net: Fix frag_list handling in skb_seq_read
      packet: Avoid lock_sock in mmap handler
      ipv6: Copy cork options in ip6_append_data

Holger Macht (1):
      ACPI: dock: Don't eval _STA on every show_docked sysfs read

Huang Weiyi (5):
      uwb: remove unused #include <version.h>'s
      Btrfs: removed unused #include <version.h>'s
      Btrfs: remove duplicated #include
      V4L/DVB (10193): removed unused #include <version.h>'s
      MIPS: Octeon: Remove duplicated #includes

Ian Campbell (1):
      IDE: Unregister and disable devices if initialization fails.

Inaky Perez-Gonzalez (1):
      wimax: fix build issue when debugfs is disabled

Ingo Molnar (2):
      irq: export __set_irq_handler() and handle_level_irq()
      x86: tone down mtrr_trim_uncached_memory() warning

Ira W. Snyder (1):
      virtio_net: use correct accessors for scatterlists

Ivan Kokshaysky (3):
      alpha: use syscall wrappers
      alpha: compile fixes
      alpha: fix the BUG() macro

James Bottomley (1):
      x86/Voyager: make it build and boot

Jan Engelhardt (2):
      UBI: constify file operations
      Btrfs: change/remove typedef

Jan Kara (2):
      ocfs2: Push out dropping of dentry lock to ocfs2_wq
      ocfs2: Fix possible deadlock in ocfs2_write_dquot()

Jarkko Nikula (1):
      ARM: OMAP: DMA: Fix uninitialized channel flags

Jarod Wilson (1):
      HID: add antec-branded soundgraph imon devices to blacklist

Jaswinder Singh Rajput (90):
      headers_check fix: can/bcm.h
      headers_check fix: dvb/audio.h
      headers_check fix: dvb/dmx.h
      headers_check fix: dvb/frontend.h
      headers_check fix: dvb/net.h
      headers_check fix: dvb/video.h
      headers_check fix: netfilter/xt_conntrack.h
      headers_check fix: nfsd/export.h
      headers_check fix: nfsd/nfsfh.h
      headers_check fix: nfsd/syscall.h
      headers_check fix: raid/md_p.h
      headers_check fix: spi/spidev.h
      headers_check fix: tc_act/tc_gact.h
      headers_check fix: tc_act/tc_mirred.h
      headers_check fix: tc_act/tc_pedit.h
      headers_check fix: tc_ematch/tc_em_cmp.h
      headers_check fix: tc_ematch/tc_em_meta.h
      headers_check fix: tc_ematch/tc_em_nbyte.h
      headers_check fix: tc_ematch/tc_em_text.h
      headers_check fix: usb/cdc.h
      headers_check fix: usb/gadgetfs.h
      headers_check fix: linux/aio_abi.h
      headers_check fix: linux/atalk.h
      headers_check fix: linux/atmbr2684.h
      headers_check fix: linux/auto_fs4.h
      headers_check fix: linux/bfs_fs.h
      headers_check fix: linux/blktrace_api.h
      headers_check fix: linux/capability.h
      headers_check fix: linux/cdrom.h
      headers_check fix: linux/cgroupstats.h
      headers_check fix: linux/dlm_plock.h
      headers_check fix: linux/dn.h
      headers_check fix: linux/edd.h
      headers_check fix: linux/efs_fs_sb.h
      headers_check fix: linux/elf-fdpic.h
      headers_check fix: linux/elf.h
      headers_check fix: linux/errqueue.h
      headers_check fix: linux/genetlink.h
      headers_check fix: linux/gfs2_ondisk.h
      headers_check fix: linux/hid.h
      headers_check fix: linux/hiddev.h
      headers_check fix: linux/icmpv6.h
      headers_check fix: linux/if_addr.h
      headers_check fix: linux/if_addrlabel.h
      headers_check fix: linux/if_fc.h
      headers_check fix: linux/if_hippi.h
      headers_check fix: linux/if_link.h
      headers_check fix: linux/if_ppp.h
      headers_check fix: linux/if_strip.h
      headers_check fix: linux/if_tr.h
      headers_check fix: linux/igmp.h
      headers_check fix: linux/inet_diag.h
      headers_check fix: linux/ip6_tunnel.h
      headers_check fix: linux/ipv6.h
      headers_check fix: linux/ipv6_route.h
      headers_check fix: linux/ipx.h
      headers_check fix: linux/irda.h
      headers_check fix: linux/minix_fs.h
      headers_check fix: linux/msdos_fs.h
      headers_check fix: linux/neighbour.h
      headers_check fix: linux/nfs_idmap.h
      headers_check fix: linux/phonet.h
      headers_check fix: linux/pkt_cls.h
      headers_check fix: linux/pkt_sched.h
      headers_check fix: linux/ppp_defs.h
      headers_check fix: linux/random.h
      headers_check fix: linux/signalfd.h
      headers_check fix: linux/sound.h
      headers_check fix: linux/synclink.h
      headers_check fix: linux/taskstats.h
      headers_check fix: linux/video_decoder.h
      headers_check fix: linux/video_encoder.h
      headers_check fix: linux/videodev.h
      headers_check fix: linux/virtio_blk.h
      headers_check fix: linux/virtio_console.h
      headers_check fix: linux/virtio_net.h
      headers_check fix: mtd/inftl-user.h
      headers_check fix: sound/hdsp.h
      headers_check fix: video/sisfb.h
      headers_check fix: video/uvesafb.h
      headers_check fix: linux/nubus.h
      headers_check fix: linux/rtnetlink.h
      headers_check fix: x86, e820.h
      headers_check fix: x86, kvm.h
      headers_check fix: x86, mce.h
      headers_check fix: x86, mtrr.h
      headers_check fix: x86, ptrace-abi.h
      headers_check fix: x86, sigcontext.h
      headers_check fix: x86, sigcontext32.h
      headers_check fix: x86, swab.h

Jean-Francois Moine (1):
      V4L/DVB (10385): gspca - main: Fix memory leak when USB disconnection while streaming.

Jeff Layton (2):
      cifs: turn smb_send into a wrapper around smb_sendv
      cifs: make sure we allocate enough storage for socket address

Jeff Mahoney (1):
      kmalloc: return NULL instead of link failure

Jens Axboe (8):
      block: get rid of the manual directory counting in blktrace
      block: seperate bio/request unplug and sync bits
      block: add bio_rw_flagged() for testing bio->bi_rw
      block: silently error an unsupported barrier bio
      block: add sysfs file for controlling io stats accounting
      block: fix oops in blk_queue_io_stat()
      block: fix inconsistent parenthesisation of QUEUE_FLAG_DEFAULT
      block: add text file detailing queue/ sysfs files

Jeremy Fitzhardinge (2):
      xen: make sysfs files behave as their names suggest
      xen: disable interrupts before saving in percpu

Jesper Dangaard Brouer (1):
      udp: Fix UDP short packet false positive

Jesse Brandeburg (1):
      e1000: fix bug with shared interrupt during reset

Jie Zhang (2):
      Blackfin arch: Add one more check on `fp' to prevent double fault
      Blackfin arch: fix 2 bugs related to debug

Jim Owens (1):
      Btrfs: selinux support Add call to LSM security initialization and save resulting security xattr for new inodes.

Jiri Kosina (2):
      HID: adjust report descriptor fixup for MS 1028 receiver
      HID: document difference between hid_blacklist and hid_ignore_list

Jiri Pirko (1):
      net: fix xfrm reverse flow lookup for icmp6

Jiri Tersel (1):
      lis3lv02d: add axes knowledge for HP 6510b

Joe Perches (1):
      Btrfs: MAINTAINERS entry

Joel Becker (1):
      configfs: Silence lockdep on mkdir(), rmdir() and configfs_depend_item()

Joerg Schirottke (1):
      ALSA: hda - Add quirk for HP DV6700 laptop

Johannes Berg (1):
      mac80211: remove Michael Wu as maintainer

Johannes Weiner (1):
      wait: prevent exclusive waiter starvation

Josef Bacik (2):
      Btrfs: cleanup xattr code
      Btrfs: join the transaction in __btrfs_setxattr

Juha Yrjola (1):
      ARM: OMAP: Fix race in OMAP2/3 DMA IRQ handling

KAMEZAWA Hiroyuki (4):
      cgroups: use hierarchy mutex in creation failure path
      memcg: fix refcnt handling at swapoff
      memcg: update document to mention that swapoff should be tested
      memcg: NULL pointer dereference at rmdir on some NUMA systems

Karsten Keil (1):
      e1000: Fix PCI enable to honor the need_ioport flag

Kay Sievers (2):
      ide: struct device - replace bus_id with dev_name(), dev_set_name()
      ACPI: struct device - replace bus_id with dev_name(), dev_set_name()

Kevin Hilman (1):
      ARM: OMAP: fix fault in enter_full_retention()

Kuninori Morimoto (4):
      sh: mach-migor: Enable ov772x and tw9910 in defconfig.
      sh: ap325rxa: control camera power toggling.
      sh: ap325rxa: Add ov772x support.
      sh: ap325rxa: Enable ov772x in defconfig.

Lai Jiangshan (1):
      ring_buffer: reset write when reserve buffer fail

Larry Finger (1):
      rtl8187: Fix error in setting OFDM power settings for RTL8187L

Laurent Pinchart (3):
      V4L/DVB (10197): uvcvideo: Whitespace and comments cleanup, copyright updates.
      V4L/DVB (10198): uvcvideo: Print the UVC version number in binary-coded decimal.
      V4L/DVB (10199): uvcvideo: Fix GET_DEF failure detection.

Len Brown (6):
      ACPI: remove locking from PM1x_STS register reads
      ACPI: remove BM_RLD access from idle entry path
      ACPICA: add debug dump of BIOS _OSI strings
      ACPI: make some IO ports off-limits to AML
      ACPI: delete CPU_IDLE=n code
      ACPI: disable ACPI cleanly when bad RSDP found

Li Zefan (2):
      cgroups: fix lock inconsistency in cgroup_clone()
      fork.c: fix NULL pointer dereference when nr_threads == threads-max

Liam Girdwood (1):
      ALSA: ASoC: email - update email addresses.

Linus Torvalds (5):
      Fix OOPS in mmap_region() when merging adjacent VM_LOCKED file segments
      Allow opportunistic merging of VM_CAN_NONLINEAR areas
      Stop playing silly games with the VM_ACCOUNT flag
      Manually revert "mlock: downgrade mmap sem while populating mlocked regions"
      Linux 2.6.29-rc4

Linus Walleij (1):
      mmci: Add support for ST Micro derivate

Luis R. Rodriguez (2):
      cfg80211: Fix sanity check on 5 GHz when processing country IE
      cfg80211: print correct intersected regulatory domain

Luke Yelavich (1):
      ALSA: hda - add another MacBook Pro 4, 1 subsystem ID

Maciej Sosnowski (1):
      dca: redesign locks to fix deadlocks

Magnus Damm (1):
      gpiolib: fix request related issue

Manish Katiyar (2):
      r6040: Remove unused variable pdev from drivers/net/r6040.c
      rtc-ds1390: fix compilation warnings in drivers/rtc/rtc-ds1390.c

Manuel Lauss (1):
      MIPS: Alchemy: time.c build fix

Mark Brown (1):
      ASoC: Fix null string usage with WM8753 DAIs

Mark Eggleston (1):
      ALSA: hda - Add support of iMac 24 Aluminium

Mark Fasheh (2):
      ocfs2: add quota call to ocfs2_remove_btree_range()
      Revert "configfs: Silence lockdep on mkdir(), rmdir() and configfs_depend_item()"

Mark Lord (1):
      sata_mv: Fix chip type for Hightpoint RocketRaid 1740/1742

Mark McLoughlin (1):
      virtio-pci: do not oops on config change if driver not loaded

Mark Wallis (1):
      lguest: Fix a memory leak with the lg object during launcher close

Markus Metzger (1):
      x86, ds, bts: cleanup/fix DS configuration

Martin Dauskardt (1):
      V4L/DVB (10216): saa7127: fix broken S-Video with saa7129

Martin Hicks (1):
      x86: push old stack address on irqstack for unwinder

Martin K. Petersen (3):
      block: Don't verify integrity metadata on read error
      block: Remove obsolete BUG_ON
      block: Allow empty integrity profile

Martin Kebert (1):
      lis3lv02d: add axes knowledge for HP 6710

Masami Hiramatsu (2):
      kprobes: fix module compilation error with CONFIG_KPROBES=n
      prevent kprobes from catching spurious page faults

Matthew Garrett (5):
      eeepc-laptop: Add support for extended hotkeys
      eeepc-laptop: Check return values from rfkill_register
      eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop
      PCI hotplug: Change link order of pciehp & acpiphp
      misc: dell-laptop should depend on POWER_SUPPLY

Matthew Wilcox (1):
      PCI MSI: Fix undefined shift by 32

Matthias Dahl (1):
      V4L/DVB (9054): implement proper locking in the dvb ca en50221 driver

Mauro Carvalho Chehab (6):
      V4L/DVB (10192): em28xx: fix input selection
      V4L/DVB (10201): Fixes cx88 compilation bug
      V4L/DVB (10208): zoran: Re-adds udev entry removed by changeset 60b4bde4
      V4L/DVB (10209): tveeprom: Properly initialize tuner type (BZ#11367)
      V4L/DVB (10228): em28xx: fix audio output PCM IN selection
      V4L/DVB (10403): saa7134-alsa: saa7130 doesn't support digital audio

Miao Xie (1):
      cpuset: fix possible deadlock in async_rebuild_sched_domains

Michael Hennerich (9):
      Blackfin arch: Fix Bug - Kernel does not boot if re-program clocks
      Blackfin arch: Fix Bug - request lines with peripheral_request_list, but don't get freed with peripheral_free_list
      Blackfin arch: reset POLAR setting when acquiring a gpio for the first time
      Blackfin arch: Faster Implementation of csum_tcpudp_nofold()
      Blackfin arch: Update CM-BF527 kernel config
      Blackfin arch: Add BF561 PPI POLS, POLC Masks
      Blackfin arch: Update Copyright information
      Blackfin arch: Fix udelay implementation
      Blackfin arch: Remove outdated code

Mike Frysinger (15):
      Blackfin arch: scrub comments/whitespace/cvs keywords
      Blackfin arch: add support for mobile ddr bf54x parts
      Blackfin arch: line up machine-/cpu- vars after BF54xM addition
      Blackfin arch: fix bug - Dmacopy failed in BF537-STAMP
      Blackfin arch: cleanup bf54x ifdef mess in gpio code
      MAINTIANERS: Blackfin: remove subscribers-only marking
      Blackfin arch: sync reboot handler with version in u-boot
      Blackfin arch: bfin_reset->_bfin_reset redirection no longer needed
      Blackfin arch: drop CONFIG_I2C_BOARDINFO ifdefs
      Blackfin arch: fixup board init function name
      Blackfin arch: read SYSCR on newer parts that mirror the bits of SWRST in it
      Blackfin arch: base SIC_IWR# programming on whether the MMR exists
      Blackfin arch: build jtag tty driver as a module by default
      Blackfin arch: cplb mananger: use a do...while loop rather than a for loop
      Blackfin arch: define bfin_memmap as static since it is only used here

Mike Galbraith (1):
      sched: clear buddies more aggressively

Mike Isely (1):
      V4L/DVB (10240): Fix obvious swapped names in v4l2_subdev logic

Mike Rapoport (1):
      drivers/video/backlight: rename da903x to da903x_bl

Mikulas Patocka (1):
      Fix memory corruption in console selection

Misael Lopez Cruz (1):
      ASoC: OMAP: Initialize XCCR and RCCR registers in McBSP DAI driver

Myron Stowe (1):
      ACPICA: Fix table entry truncation calculation

NeilBrown (2):
      md: Allow read error in a single drive raid1 to be passed up.
      md: Ensure an md array never has too many devices.

Nicolas Fournier (1):
      V4L/DVB (10233): [PATCH] Terratec Cinergy DT XS Diversity new USB ID (0ccd:0081)

Nicolas Pitre (1):
      [ARM] 5366/1: fix shared memory coherency with VIVT L1 + L2 caches

Nikanth Karthikesan (1):
      Mark mandatory elevator functions in the biodoc.txt

Oleg Nesterov (2):
      Staging: android: task_get_unused_fd_flags: fix the wrong usage of tsk->signal
      ftrace: do_each_pid_task() needs rcu lock

Oliver Neukum (1):
      HID: fix reversed logic in disconnect testing of hiddev

Pallipadi, Venkatesh (1):
      ACPI: Enable bit 11 in _PDC to advertise hw coord

Pasi Kärkkäinen (1):
      [libata] sata_sil: Fix compilation error with libata debugging enabled

Paul Larson (1):
      Add enable_ms to jsm driver

Paul Menage (2):
      cgroups: add cpu_relax() calls in css_tryget() and cgroup_clear_css_refs()
      cgroup: fix root_count when mount fails due to busy subsystem

Paul Mundt (1):
      sh: Fix up spurious syscall restarting.

Pavel Herrmann (1):
      lis3lv02d: add axes knowledge for HP 6730

Peter Zijlstra (4):
      sched: fix sync wakeups
      sched: symmetric sync vs avg_overlap
      sched: fix buddie group latency
      generic swap(): don't return a value from swap()

Petr Vandrovec (1):
      firewire: core: Remove card from list of cards when enable fails

Phil Sutter (14):
      MIPS: RB532: Fix bit swapping in rb532_set_bit()
      MIPS: RC32434: Define io_map_base for PCI controller
      MIPS: RB532: Add set_type() function to IRQ struct.
      MIPS: RB532: Auto disable GPIO alternate function
      MIPS: RB532: remove useless CF GPIO initialisation
      MIPS: RB532: Detect uart type, add platform device
      MIPS: RB532: Use driver_data instead of platform_data
      MIPS: RB532: Fix init of rb532_dev3_ctl_res
      MIPS: RB532: Fix set_latch_u5()
      MIPS: RB532: Move dev3 init code to devices.c
      MIPS: RB532: Remove {get,set}_434_reg()
      MIPS: RB532: Simplify dev3 init
      MIPS: RB532: Update headers
      MIPS: RB532: Export rb532_gpio_set_func()

Philipp Zabel (1):
      regulator: move bq24022 init back to module_init instead of subsys_initcall

Philippe De Muyter (1):
      tulip: fix 21142 with 10Mbps without negotiation

Qinghuang Feng (3):
      Btrfs: check return value for kthread_run() correctly
      Btrfs: simplify iteration codes
      Btrfs: open_ctree() error handling can oops on fs_info

Rafael J. Wysocki (13):
      PM: Fix compilation warning in kernel/power/main.c
      ACPI suspend: Fix compilation warnings in drivers/acpi/sleep.c
      PCI PM: Fix suspend error paths and testing facility breakage
      PCI PM: Fix hibernation breakage on EeePC 701
      PCI PM: Power up devices before restoring their state
      PCI PM: Do not wait for buses in B2 or B3 during resume
      PCI PM: Fix handling of devices without drivers
      PCI PM: Check if the state has been saved before trying to restore it
      PCI PM: Fix saving of device state in pci_legacy_suspend
      PCI: PCIe portdrv: Simplify suspend and resume
      PCI PM: Do not disable and enable bridges during suspend-resume
      PCI PM: Read power state from device after trying to change it on resume
      PCI PM: make the PM core more careful with drivers using the new PM framework

Ralf Baechle (7):
      MIPS: SMTC: Fix build after recent creditial changes.
      MIPS: Avoid destructive invalidation on partial cachelines.
      MIPS: Port "mm: invoke oom-killer from page fault" from UML / x86
      MIPS: atomic_*(): Change type of intermediate variables.
      MIPS: Add return value checks to user_termio_to_kernel_termios()
      MIPS: IP27: Switch from DMA_IP27 to DMA_COHERENT
      MIPS: R2: Fix broken installation of cache error handler.

Randy Dunlap (7):
      driver-core: fix kernel-doc parameter name
      Documentation: move DMA-mapping.txt to Doc/PCI/
      libata: fix kernel-doc warnings
      sched: add missing kernel-doc in sched.h
      sunrpc: fix rdma dependencies
      maintainers: general@lists.openfabrics.org is moderated
      atyfb: fix CONFIG_ namespace violations

Reinette Chatre (2):
      iwlwifi: clean key table in iwl_clear_stations_table
      iwlwifi: save PCI state before suspend, restore after resume

Risto Suominen (1):
      fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks

Robert Krakora (4):
      V4L/DVB (10254): em28xx: Fix audio URB transfer buffer race condition
      V4L/DVB (10256): em28xx: Fix for KWorld 330U AC97
      V4L/DVB (10257): em28xx: Fix for KWorld 330U Board
      V4L/DVB (10325): em28xx: Fix for fail to submit URB with IRQs and Pre-emption Disabled

Robin Getz (5):
      Blackfin arch: Print out where the bootmode is coming from (for easier debugging).
      Blackfin arch: don't accidently re-enable interrupts
      Blackfin arch: Fix URL
      Blackfin arch: Add a few more instructions that can cause the trace buffer to be discontiguous
      Blackfin arch: Add ability to count and display number of NMI interrupts

Robin Holt (3):
      sgi-xpc: ensure flags are updated before bte_copy
      sgi-xpc: Remove NULL pointer dereference.
      sgi-xpc: fix up stale DBUG_ON statements

Roel Kluin (10):
      panasonic-laptop: fix X[ ARRAY_SIZE(X) ]
      Staging: usbip: usbip_start_threads(): handle kernel_thread failure
      Staging: poch: fix verification of memory area
      smsc911x: timeout reaches -1
      drivers/net/skfp: if !capable(CAP_NET_ADMIN): inverted logic
      leds: Fix bounds checking of wm8350->pmic.led
      ALSA: alsa: time reaches -1, tested 0
      net: variables reach -1, but 0 tested
      cassini/sungem: limit reaches -1, but 0 tested
      ALSA: pcm_oss: AFMT_S24_LE is set twice in return value

Roland Dreier (1):
      Btrfs: Remove extra KERN_INFO in the middle of a line

Roland McGrath (2):
      elf core dump: fix get_user use
      x86-64: fix int $0x80 -ENOSYS return

Ron Mercer (3):
      qlge: bugfix: Fix endian issue when reading flash.
      qlge: bugfix: Add flash offset for second port.
      qlge: bugfix: Add missing netif_napi_del call.

Russell King (3):
      [ARM] etherh: continue fixing build failure
      [ARM] msm: fix build errors
      [ARM] call undefined instruction exception handler with irqs enabled

Rusty Russell (3):
      cpumask: convert lib/smp_processor_id to new cpumask ops
      sched_rt: don't use first_cpu on cpumask created with cpumask_and
      module: remove over-zealous check in __module_get()

Samuel Thibault (1):
      Fix my email address in qd65xx.[ch]/pata_qdi.c

Sascha Hauer (1):
      mmc: Add a MX2/MX3 specific SDHC driver

Sebastian Andrzej Siewior (1):
      V4L/DVB (10202): [PATCH] v4l/tvp514x: Don't write after line end

Sebastiano Di Paola (1):
      net: packet socket packet_lookup_frame fix

Sebastien Dugue (1):
      hrtimers: allow the hot-unplugging of all cpus

Sergei Shtylyov (1):
      ide/libata: fix ata_id_is_cfa() (take 4)

Seth Heasley (1):
      PCI: irq and pci_ids patch for Intel Tigerpoint DeviceIDs

Shyam Iyer (1):
      net: Fix OOPS in skb_seq_read().

Sidney Amani (1):
      UBI: allow direct user-space I/O

Simon Harrison (1):
      V4L/DVB (10210): Fix a bug on v4lgrab.c

Simon Holm Thøgersen (1):
      ext4: fix wrong use of do_div

Sonic Zhang (2):
      Blackfin arch: enable bfin_eth in bf51x by default
      Blackfin arch: Fix bug - Run "reboot" hangs bf518-ezbrd

Stanley.Miao (1):
      ARM: OMAP: Fix McBSP spin_lock deadlock

Stefan Richter (18):
      firewire: insist on successive self ID complete events
      firewire: unnecessary BM delay after generation rollover
      firewire: keep highlevel drivers attached during brief connection loss
      firewire: ohci: change "context_stop: still active" log message
      firewire: ohci: increase AT req. retries, fix ack_busy_X from Panasonic camcorders and others
      ieee1394: ohci1394: increase AT req. retries, fix ack_busy_X from Panasonic camcorders and others
      firewire: core: optimize card shutdown
      ieee1394: support for speeds greater than S800
      ieee1394: sbp2: update a help string
      ieee1394: sbp2: fix payload limit at S1600 and S3200
      ieee1394: sbp2: don't assume zero model_id or firmware_revision if there is none
      firewire: sbp2: fix payload limit at S1600 and S3200
      firewire: sbp2: define some magic numbers as macros
      firewire: sbp2: fix DMA mapping leak on the failure path
      firewire: sbp2: add workarounds for 2nd and 3rd generation iPods
      ieee1394: sbp2: add workarounds for 2nd and 3rd generation iPods
      ieee1394: dv1394: move deprecation message from module init to file open
      async: use list_move_tail

Stephen Hemminger (1):
      net: update documentation ip aliases

Stephen Rothwell (2):
      powerpc/ps3: Printing fixups for l64 to ll64 convserion drivers/net
      sparc: fixup for sparseirq changes

Steve French (4):
      [CIFS] Rename md5 functions to avoid collision with new rt modules
      [CIFS] revalidate parent inode when rmdir done within that directory
      [CIFS] some cleanup to dir.c prior to addition of posix_open
      [CIFS] Make socket retry timeouts consistent between blocking and nonblocking cases

Steve Glendinning (1):
      smsc9420: fix interrupt signalling test failures

Steve Hodgson (6):
      sfc: SFT9001: Enable robust link training
      sfc: SFX7101: Remove workaround for bad link training
      sfc: SFT9001: Fix speed reporting in 1G PHY loopback
      sfc: Fix post-reset MAC selection
      sfc: Reinitialise the PHY completely in case of a PHY or NIC reset
      sfc: Test for PHYXS faults whenever we cannot test link state bits

Steven Rostedt (6):
      ring-buffer: fix alignment problem
      trace: print ftrace_dump at KERN_EMERG log level
      trace: stop all recording to ring buffer on ftrace_dump
      trace: set max latency variable to zero on default
      ring-buffer: reset timestamps when ring buffer is reset
      generic-ipi: use per cpu data for single cpu ipi calls

Stuart Menefy (1):
      sh: Handle calling csum_partial with misaligned data

Sunil Mushran (1):
      ocfs2: Wakeup the downconvert thread after a successful cancel convert

Takashi Iwai (8):
      ALSA: hda - Fix PCM reference NID for STAC/IDT analog outputs
      ALSA: hda - Fix compile warning with CONFIG_SND_JACK=n
      ALSA: hda - Add quirk for another HP dv5 model
      ALSA: hda - No widget selection for volume knob widgets in proc output
      ALSA: hda - Add quirk for FSC Amilo Xi2550
      ALSA: hda - Fix misc workqueue issues
      ALSA: hda - Add missing initialization for ALC272
      ALSA: hda - Add missing COEF initialization for ALC887

Takashi Yoshii (1):
      sh: Fix up T-bit error handling in SH-4A mutex fastpath.

Tao Ma (1):
      ocfs2: Access the xattr bucket only before modifying it.

Teemu Likonen (1):
      Documentation: update CodingStyle tips for Emacs users

Tejun Heo (9):
      sata_nv: ck804 has borked hardreset too
      libata: fix EH device failure handling
      libata: move ata_dev_disable() to libata-eh.c
      libata: check onlineness before using SPD in sata_down_spd_limit()
      libata: clear dev->ering in smarter way
      libata: add @spd_limit to sata_down_spd_limit()
      libata: improve probe failure handling
      libata: add no penalty retry request for EH device handling routines
      libata: implement HORKAGE_1_5_GBPS and apply it to WD My Book

Tero Roponen (1):
      ACPI: Fix crash on ASUS laptops

Thadeu Lima de Souza Cascardo (1):
      ext4: Fix building with EXT4FS_DEBUG

Theodore Ts'o (8):
      ext4: only use i_size_high for regular files
      ext4: Add sanity check to make_indexed_dir
      ext3: Add sanity check to make_indexed_dir
      jbd2: On a __journal_expect() assertion failure printk "JBD2", not "EXT3-fs"
      ext4: Fix ext4_free_blocks() w/o a journal when files have indirect blocks
      ext4: Initialize the new group descriptor when resizing the filesystem
      ext4: Remove bogus BUG() check in ext4_bmap()
      block: Fix documentation for blkdev_issue_flush()

Thierry Vignaud (1):
      ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name.

Thomas Gleixner (1):
      hrtimer: prevent negative expiry value after clock_was_set()

Thomas Goff (1):
      IPv6: Fix multicast routing bugs.

Thomas Renninger (1):
      ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries

Tim 'mithro' Ansell (1):
      lguest: disable the FORTIFY for lguest.

Timothy S. Nelson (1):
      PCI: return error on failure to read PCI ROMs

Tony Battersby (1):
      shm: fix shmctl(SHM_INFO) lockup with !CONFIG_SHMEM

Tony Broad (1):
      V4L/DVB (10265): budget.c driver: Kernel oops: "BUG: unable to handle kernel paging request at ffffffff

Tony Lindgren (2):
      ARM: OMAP: Fix omap34xx revision detection for ES3.1
      ARM: OMAP: Fix hsmmc init, v2

Trent Piepho (6):
      V4L/DVB (10212): Convert to be a pci driver
      V4L/DVB (10222): zoran: Better syntax for initializing array module params
      V4L/DVB (10223): zoran: Remove global device array
      V4L/DVB (10224): zoran: Use pci device table to get card type
      V4L/DVB (10225): zoran: Remove zr36057_adr field
      V4L/DVB (10226): zoran: Get rid of extra module ref count

Tsugikazu Shibata (1):
      Sync patch for jp_JP/stable_kernel_rules.txt

Tyler Hicks (1):
      eCryptfs: Regression in unencrypted filename symlinks

Uwe Kleine-Koenig (1):
      Blackfin arch: explicit add a might sleep to gpio_free

Uwe Kleine-König (6):
      Use __SPIN_LOCK_UNLOCKED to initialize bad_irq_desc.lock
      annotate that [fp, #-4] is the saved lr
      rename platform_driver name "flash" to "sa1100-mtd"
      NVRAM depends on RTC_DRV_CMOS
      add another mailmap entry for Uwe Kleine-König
      Add Sascha Hauer to .mailmap

Wang Cong (1):
      Btrfs: cleanup fs/btrfs/super.c::btrfs_control_ioctl()

Yan Zheng (4):
      Btrfs: fix locking issue in btrfs_remove_block_group
      Btrfs: Fix infinite loop in btrfs_extent_post_op
      Btrfs: fix stop searching test in replace_one_extent
      Btrfs: fix tree logs parallel sync

Yehuda Sadeh (1):
      Btrfs: fiemap support

Yinghai Lu (1):
      irq, x86: fix lock status with numa_migrate_irq_desc

Yusuf Altin (1):
      V4L/DVB (10195): [PATCH] add Terratec Cinergy T Express to dibcom driver

Zhao Yakui (2):
      ACPI: Skip the first two elements in the _BCL package
      ACPI: proc_dir_entry 'video/VGA' already registered

Zhu, Yi (1):
      iwlwifi: fix kernel oops when ucode DMA memory allocation failure

philipl@overt.org (1):
      ricoh_mmc: Use suspend_late/resume_early

김규원 (1):
      ARM: OMAP: Mask interrupts when disabling interrupts, v2

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Linus 2.6.29-rc4
  2009-02-08 21:01 Linus 2.6.29-rc4 Linus Torvalds
@ 2009-02-09  1:21 ` Arjan van de Ven
  2009-02-09  8:28   ` Ingo Molnar
  2009-02-09 13:34 ` Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 50+ messages in thread
From: Arjan van de Ven @ 2009-02-09  1:21 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

On Sun, 8 Feb 2009 13:01:04 -0800 (PST)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> Another week (and a half), another -rc.
> 
> Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> updates, FS updates (ubifs, btrfs), you name it. It's all there.
> 
> But more importantly, people really have been working on regressions,
> and hopefully this closes a nice set of the top one, and hopefully
> without introducing too many new ones.
> 
> 			Linus


I just looked at the top -rc3 oopses/warnings/etc

quick summary of the top ones:
(manual rather than the normal automated scripts, so the format is
different)
"regulars" that happened a lot prior to  .29 (eg clearly non-regressions) I marked with a *

Oopses: 78 oopses reported
--------------------------
12 times	i915_driver_irq_handler		http://www.kerneloops.org/searchweek.php?search=i915_driver_irq_handler
8 times		apic_mmio_read			http://www.kerneloops.org/searchweek.php?search=apic_mmio_read


BUG/BUG_ON:	16 reports
--------------------------
6 times		i915_gem_object_unpin		http://www.kerneloops.org/searchweek.php?i915_gem_object_unpin
2 times		__schedule			http://www.kerneloops.org/searchweek.php?__schedule


WARN/WARN_ON/etc:	999 reports
-----------------------------------
213 times	check_unmap			http://www.kerneloops.org/searchweek.php?search=check_unmap
164 times	last_sector_hacks		http://www.kerneloops.org/searchweek.php?search=last_sector_hack
94 times	*mpt_config			http://www.kerneloops.org/searchweek.php?search=mpt_config
92 times	reserve_pfn_range		http://www.kerneloops.org/searchweek.php?search=reserve_pfn_range
79 times	*init_ck804xrom			http://www.kerneloops.org/searchweek.php?search=init_ck804xrom
56 times	*iwl_set_dynamic_key		http://www.kerneloops.org/searchweek.php?search=iwl_set_dynamic_key
39 times	check_sync			http://www.kerneloops.org/searchweek.php?search=check_sync
35 times	track_pfn_vma_copy		http://www.kerneloops.org/searchweek.php?search=track_pfn_vma_cop

-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Linus 2.6.29-rc4
  2009-02-09  1:21 ` Arjan van de Ven
@ 2009-02-09  8:28   ` Ingo Molnar
  2009-02-09 12:18     ` Avi Kivity
  0 siblings, 1 reply; 50+ messages in thread
From: Ingo Molnar @ 2009-02-09  8:28 UTC (permalink / raw)
  To: Arjan van de Ven, Avi Kivity; +Cc: Linus Torvalds, Linux Kernel Mailing List


* Arjan van de Ven <arjan@infradead.org> wrote:

> On Sun, 8 Feb 2009 13:01:04 -0800 (PST)
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> > 
> > Another week (and a half), another -rc.
> > 
> > Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> > updates, FS updates (ubifs, btrfs), you name it. It's all there.
> > 
> > But more importantly, people really have been working on regressions,
> > and hopefully this closes a nice set of the top one, and hopefully
> > without introducing too many new ones.
> > 
> > 			Linus
> 
> 
> I just looked at the top -rc3 oopses/warnings/etc
> 
> quick summary of the top ones:
> (manual rather than the normal automated scripts, so the format is
> different)
> "regulars" that happened a lot prior to  .29 (eg clearly non-regressions) I marked with a *
> 
> Oopses: 78 oopses reported
> --------------------------
> 12 times	i915_driver_irq_handler		http://www.kerneloops.org/searchweek.php?search=i915_driver_irq_handler
> 8 times		apic_mmio_read			http://www.kerneloops.org/searchweek.php?search=apic_mmio_read

The last one seems KVM related.

	Ingo

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Linus 2.6.29-rc4
  2009-02-09  8:28   ` Ingo Molnar
@ 2009-02-09 12:18     ` Avi Kivity
  0 siblings, 0 replies; 50+ messages in thread
From: Avi Kivity @ 2009-02-09 12:18 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Arjan van de Ven, Linus Torvalds, Linux Kernel Mailing List

Ingo Molnar wrote:
>> 8 times		apic_mmio_read			http://www.kerneloops.org/searchweek.php?search=apic_mmio_read
>>     
>
> The last one seems KVM related.
>   

Yes, it is.  Are there any human reports rather than kerneloops reports?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Linus 2.6.29-rc4
  2009-02-08 21:01 Linus 2.6.29-rc4 Linus Torvalds
  2009-02-09  1:21 ` Arjan van de Ven
@ 2009-02-09 13:34 ` Gerd Hoffmann
  2009-02-09 15:04   ` Steven Noonan
  2009-02-09 18:26 ` Oopses and ACPI problems (Linus 2.6.29-rc4) Darren Salt
  2009-02-10 14:02 ` [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4) Mel Gorman
  3 siblings, 1 reply; 50+ messages in thread
From: Gerd Hoffmann @ 2009-02-09 13:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

Hmm, Linu*s* 2.6.29-rc4?
Tyops or hidden message?

/me remembers the "Linus 2.0" announcement ...

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Linus 2.6.29-rc4
  2009-02-09 13:34 ` Gerd Hoffmann
@ 2009-02-09 15:04   ` Steven Noonan
  0 siblings, 0 replies; 50+ messages in thread
From: Steven Noonan @ 2009-02-09 15:04 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Linus Torvalds, Linux Kernel Mailing List

On Mon, Feb 9, 2009 at 5:34 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hmm, Linu*s* 2.6.29-rc4?
> Tyops or hidden message?
>
> /me remembers the "Linus 2.0" announcement ...
>
> cheers,
>  Gerd

Funny part is I didn't notice it at all until you said something. I
wonder how many other people didn't notice...

- Steven

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-08 21:01 Linus 2.6.29-rc4 Linus Torvalds
  2009-02-09  1:21 ` Arjan van de Ven
  2009-02-09 13:34 ` Gerd Hoffmann
@ 2009-02-09 18:26 ` Darren Salt
  2009-02-09 23:49     ` Ingo Molnar
  2009-02-10  1:06     ` yakui_zhao
  2009-02-10 14:02 ` [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4) Mel Gorman
  3 siblings, 2 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-09 18:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-acpi

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
(captured via netconsole) and decoded oops data attached ¹. The last few
oopses were followed by a scrambled display and a hard lockup.

All oopses follow an otherwise successful suspend-to-RAM.

Also, I see that Fn-Fx don't seem to be reported via /proc/acpi/events any
more, or at least I'm seeing no evidence of them via acpi_listen (and, not
coincidentally, I can't adjust the volume etc. via eeepc-acpi-scripts).

The only other (significant) change is that I've installed X from Debian
experimental, though -rc3 and 2.6.28.* seem fine with this. (Oh, and I can
get UXA to cause OOM quite trivially... several Iceweasel tabs is enough.)


¹ Yes, I decided not to include symbol names in the running kernel...

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.

I'll have what the bloke on the floor is having...


[-- Attachment #2: config-eee901.gz --]
[-- Type: application/x-gzip, Size: 14395 bytes --]

[-- Attachment #3: eee-oops.txt --]
[-- Type: text/plain, Size: 9629 bytes --]

ksymoops 2.4.11 on i686 2.6.29-rc4-eee901.  Options used
     -V (default)
     -k /proc/ksyms (default)
     -l /proc/modules (default)
     -o /lib/modules/2.6.29-rc4-eee901/ (default)
     -m /boot/System.map-2.6.29-rc4-eee901 (default)

Warning: You did not tell me where to find symbol information.  I will
assume that the log matches the kernel and modules that are running
right now and I'll use the default options above for symbol resolution.
If the current kernel and/or modules do not match the log, you can get
more accurate output by telling me the kernel version and where to find
map, modules, ksyms etc.  ksymoops -h explains the options.

Error (regular_file): read_ksyms stat /proc/ksyms failed
No modules in ksyms, skipping objects
No ksyms, skipping lsmod
CPU 1 is now offline
WARNING: at fs/sysfs/group.c:138 ()
Pid: 330, comm: pciehpd Not tainted 2.6.29-rc4-eee901 #2
Call Trace:
 [<c011fab7>] 0xc011fab7
 [<c032ca9d>] 0xc032ca9d
 [<f81760d5>] 0xf81760d5
 [<c01f112c>] 0xc01f112c
 [<c0118940>] 0xc0118940
 [<c011fc82>] 0xc011fc82
 [<c016b8aa>] 0xc016b8aa
 [<c0190b6b>] 0xc0190b6b
 [<c016b9a8>] 0xc016b9a8
 [<c016b738>] 0xc016b738
 [<c019102a>] 0xc019102a
 [<c0191faa>] 0xc0191faa
 [<c025a8d4>] 0xc025a8d4
 [<c025a9c9>] 0xc025a9c9
 [<c01fae3c>] 0xc01fae3c
 [<c01faf00>] 0xc01faf00
 [<c0205ca4>] 0xc0205ca4
 [<c0204a68>] 0xc0204a68
 [<c0204eb3>] 0xc0204eb3
 [<c0204e2d>] 0xc0204e2d
 [<c012bd8f>] 0xc012bd8f
 [<c012c51d>] 0xc012c51d
 [<c012c5d1>] 0xc012c5d1
 [<c012e9ac>] 0xc012e9ac
 [<c012c51d>] 0xc012c51d
 [<c012e8de>] 0xc012e8de
 [<c012e8a6>] 0xc012e8a6
 [<c010349b>] 0xc010349b
BUG: unable to handle kernel NULL pointer dereference at 00000010
*pde = 00000000 
Oops: 0000 [#1] PREEMPT SMP 
Pid: 330, comm: pciehpd Tainted: G        W  (2.6.29-rc4-eee901 #2) 901
EIP: 0060:[<c03ccef7>] EFLAGS: 00010246 CPU: 0
Using defaults from ksymoops -t elf32-i386 -a i386
EAX: 00000000 EBX: 00000001 ECX: 00000046 EDX: 00000001
ESI: f17dd470 EDI: f70f7c5c EBP: 00000000 ESP: f7339f00
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
 f17dd45c 00000000 f70f7c5c c025a9c9 f7060b40 f7311a80ff 83 c0 89 83 cf db 74 19 f6 06 01 74 11 6a 00 ---[ end trace 449537779ba90603 ]---
Warning (Oops_read): Code line not seen, dumping what data is available


Trace; c011fab7 <warn_slowpath+7d/94>
Trace; c032ca9d <__alloc_skb+4b/103>
Trace; f81760d5 <END_OF_CODE+37c160d5/????>
Trace; c01f112c <cpumask_next_and+23/33>
Trace; c0118940 <find_busiest_group+242/725>
Trace; c011fc82 <__call_console_drivers+51/5d>
Trace; c016b8aa <find_inode+1b/56>
Trace; c0190b6b <sysfs_ilookup_test+0/d>
Trace; c016b9a8 <ifind+3a/74>
Trace; c016b738 <iput+21/4a>
Trace; c019102a <sysfs_addrm_finish+4a/1ae>
Trace; c0191faa <sysfs_remove_group+34/8d>
Trace; c025a8d4 <device_del+32/11f>
Trace; c025a9c9 <device_unregister+8/10>
Trace; c01fae3c <pci_stop_dev+20/3a>
Trace; c01faf00 <pci_remove_bus_device+27/88>
Trace; c0205ca4 <pciehp_unconfigure_device+108/180>
Trace; c0204a68 <pciehp_disable_slot+12d/1d6>
Trace; c0204eb3 <pciehp_power_thread+86/cd>
Trace; c0204e2d <pciehp_power_thread+0/cd>
Trace; c012bd8f <run_workqueue+71/f1>
Trace; c012c51d <worker_thread+0/bf>
Trace; c012c5d1 <worker_thread+b4/bf>
Trace; c012e9ac <autoremove_wake_function+0/2b>
Trace; c012c51d <worker_thread+0/bf>
Trace; c012e8de <kthread+38/5e>
Trace; c012e8a6 <kthread+0/5e>
Trace; c010349b <kernel_thread_helper+7/10>

>>EIP; c03ccef7 <klist_put+f/59>   <=====

BUG: unable to handle kernel paging request at 7a9d5f5c
*pde = 00000000 
Oops: 0000 [#2] PREEMPT SMP 
Pid: 4094, comm: bash Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
EIP: 0060:[<c015bb0a>] EFLAGS: 00010006 CPU: 1
EAX: 00000000 EBX: c04c7d90 ECX: 7a9d5f5c EDX: c180ff6c
ESI: 00000282 EDI: c04c7d90 EBP: 00000040 ESP: ee9f1e38
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 7a9d5f5c 000080d0 f173f7c0 c194c488 7ac532a8 fe280a2e c194c488 c0194004
 f173f7c0 c194c488 f6e64498 0000003e f6e02458 c019aaa0 c194c488 00000000
 ee949600 c194cff8 00000000 ee949600 ee949600 f6e02458 00000000 c019ab55
Call Trace:
 [<c0194004>] 0xc0194004
 [<c019aaa0>] 0xc019aaa0
 [<c019ab55>] 0xc019ab55
 [<c01405ce>] 0xc01405ce
 [<c0102cf1>] 0xc0102cf1
56 BUG: unable to handle kernel paging request at 7a9d5f5c
*pde = 00000000 
Oops: 0000 [#3] PREEMPT SMP 
Pid: 3147, comm: xfce4-systemloa Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
EAX: 00000000 EBX: 00000292 ECX: 7a9d5f5c EDX: c180ff6c
ESI: 00000040 EDI: c018d53c EBP: c04c7d90 ESP: f16ebe34
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 7a9d5f5c 000000d0 f702c00a ee949300 f73e35e0 c018d53c 00000000 c017059b
 00000000 f73e35e0 fffffff4 c018d53c ee949300 c0170678 00000000 f7029000
 fffffff4 00001000 ee949300 c018d51e f173f2a0 f70e9680 c018d4d0 f70e96cc
Call Trace:
 [<c018d53c>] 0xc018d53c
 [<c017059b>] 0xc017059b
 [<c018d53c>] 0xc018d53c
 [<c0170678>] 0xc0170678
 [<c018d51e>] 0xc018d51e
 [<c018d4d0>] 0xc018d4d0
 [<c01887b8>] 0xc01887b8
 [<c017006d>] 0xc017006d
 [<c012e9ac>] 0xc012e9ac
 [<c0102cf1>] 0xc0102cf1
BUG: unable to handle kernel paging request at 7a9d5f5c
*pde = 00000000 
Oops: 0000 [#4] PREEMPT SMP 
Pid: 3137, comm: xfce4-panel Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
EAX: 00000000 EBX: 00000296 ECX: 7a9d5f5c EDX: c180ff6c
ESI: 00000040 EDI: ee939f7c EBP: c04c7d90 ESP: f1653ecc
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 7a9d5f5c 000000d0 00000000 ee814440 00000000 ee939f7c 01200011 c012c900
 ee938380 eea4fff8 c048d53c ee814440 c0101a87 01200011 ee814440 00000000
 ee939f7c ee814440 00000000 ee939f7c 01200011 c011e9cb f1653fb8 bf9e8d30
Call Trace:
 [<c012c900>] 0xc012c900
 [<c0101a87>] 0xc0101a87
 [<c011e9cb>] 0xc011e9cb
 [<c011f085>] 0xc011f085
eb BUG: unable to handle kernel paging request at 7a9d5f5c
*pde = 00000000 
Oops: 0000 [#5] PREEMPT SMP 
Pid: 2942, comm: Xorg Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
EIP: 0060:[<c015bb0a>] EFLAGS: 00213006 CPU: 1
EAX: 00000000 EBX: c04c7d90 ECX: 7a9d5f5c EDX: c180ff6c
ESI: 00203282 EDI: c04c7d90 EBP: 00000040 ESP: f68adef4
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 7a9d5f5c 000000d0 00203286 00000000 fffffff4 40286454 f6a86800 f81ea6f4
 f6b2d420 f8348c59 f83583e4 f6950080 bfbc1eb4 40286454 c0167680 bfbc1eb4
 f6950080 f6f1e7f8 08a84b40 f68ac000 c0167bb4 0000000d 00203082 f68adf9c
Call Trace:
 [<f81ea6f4>] 0xf81ea6f4
 [<f8348c59>] 0xf8348c59
 [<c0167680>] 0xc0167680
 [<c0167bb4>] 0xc0167bb4
 [<c0122ac3>] 0xc0122ac3
 [<c0122c59>] 0xc0122c59
f4 BUG: unable to handle kernel paging request at 7a9d5f5c
*pde = 00000000 
Oops: 0000 [#6] PREEMPT SMP 
Pid: 1219, comm: udevd Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
EAX: 00000000 EBX: 00000292 ECX: 7a9d5f5c EDX: c180ff6c
ESI: 00000040 EDI: c018d53c EBP: c04c7d90 ESP: f68fbe34
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 7a9d5f5c 000000d0 f708c00a ee949c80 f73e3720 c018d53c 00000000 c017059b
 f6c12964 f73e3720 fffffff4 c018d53c ee949c80 c0170678 00000000 f708e000
 fffffff4 00001000 ee949c80 c018d51e f173fa20 f70e9680 c018d4d0 f70e96cc
Call Trace:
 [<c018d53c>] 0xc018d53c
 [<c017059b>] 0xc017059b
 [<c018d53c>] 0xc018d53c
 [<c0170678>] 0xc0170678
Warning (Oops_read): Code line not seen, dumping what data is available


>>EIP; c015bb0a <__kmalloc+83/c0>   <=====

>>EBX; c04c7d90 <kmalloc_caches+210/480>
>>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
>>EDI; c04c7d90 <kmalloc_caches+210/480>

Trace; c0194004 <ext3_htree_store_dirent+26/de>
Trace; c019aaa0 <htree_dirblock_to_tree+d6/11b>
Trace; c019ab55 <ext3_htree_fill_tree+70/1cb>
Trace; c01405ce <find_lock_page+10/43>
Trace; c0102cf1 <sysenter_do_call+12/25>

>>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====

>>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
>>EDI; c018d53c <show_stat+0/680>
>>EBP; c04c7d90 <kmalloc_caches+210/480>

Trace; c018d53c <show_stat+0/680>
Trace; c017059b <seq_open+23/6d>
Trace; c018d53c <show_stat+0/680>
Trace; c0170678 <single_open+48/68>
Trace; c018d51e <stat_open+4e/6c>
Trace; c018d4d0 <stat_open+0/6c>
Trace; c01887b8 <proc_reg_open+89/ed>
Trace; c017006d <single_release+0/1b>
Trace; c012e9ac <autoremove_wake_function+0/2b>
Trace; c0102cf1 <sysenter_do_call+12/25>

>>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====

>>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
>>EBP; c04c7d90 <kmalloc_caches+210/480>

Trace; c012c900 <alloc_pid+18/2b6>
Trace; c0101a87 <copy_thread+2f/f3>
Trace; c011e9cb <copy_process+917/e42>
Trace; c011f085 <do_fork+11a/268>

>>EIP; c015bb0a <__kmalloc+83/c0>   <=====

>>EBX; c04c7d90 <kmalloc_caches+210/480>
>>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
>>ESI; 00203282 <phys_startup_32+103282/c0000000>
>>EDI; c04c7d90 <kmalloc_caches+210/480>

Trace; f81ea6f4 <END_OF_CODE+37c8a6f4/????>
Trace; f8348c59 <END_OF_CODE+37de8c59/????>
Trace; c0167680 <vfs_ioctl+47/5d>
Trace; c0167bb4 <do_vfs_ioctl+446/47c>
Trace; c0122ac3 <do_setitimer+157/2a9>
Trace; c0122c59 <sys_setitimer+44/71>

>>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====

>>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
>>EDI; c018d53c <show_stat+0/680>
>>EBP; c04c7d90 <kmalloc_caches+210/480>

Trace; c018d53c <show_stat+0/680>
Trace; c017059b <seq_open+23/6d>
Trace; c018d53c <show_stat+0/680>
Trace; c0170678 <single_open+48/68>


3 warnings and 1 error issued.  Results may not be reliable.

[-- Attachment #4: eeepc.log.gz --]
[-- Type: application/x-gzip, Size: 5441 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-09 18:26 ` Oopses and ACPI problems (Linus 2.6.29-rc4) Darren Salt
@ 2009-02-09 23:49     ` Ingo Molnar
  2009-02-10  1:06     ` yakui_zhao
  1 sibling, 0 replies; 50+ messages in thread
From: Ingo Molnar @ 2009-02-09 23:49 UTC (permalink / raw)
  To: linux-kernel, linux-acpi, linux, Rafael J. Wysocki, Len Brown,
	Linus Torvalds


* Darren Salt <linux@youmustbejoking.demon.co.uk> wrote:

> I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
> (captured via netconsole) and decoded oops data attached ¹. The last few
> oopses were followed by a scrambled display and a hard lockup.
> 
> All oopses follow an otherwise successful suspend-to-RAM.

Various folks Cc:-ed. There's been a late, rather large ACPI merge, so
one post-rc3 suspect would be one of these commits:

f12b12a: Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
2d29c6a: Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec', 'misc', 'printk' and 'processor' into release
370154b: ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name.
7695fb0: eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init
386e4a8: ACPICA: Fix table entry truncation calculation
d96f94c: ACPI: Enable bit 11 in _PDC to advertise hw coord
db1461a: ACPI: struct device - replace bus_id with dev_name(), dev_set_name()
4d93915: ACPI: add missing KERN_* constants to printks
fc5a9f8: ACPI: dock: Don't eval _STA on every show_docked sysfs read
9e3a9d1: ACPI: disable ACPI cleanly when bad RSDP found
9fdd54f: ACPI: delete CPU_IDLE=n code
62663ea: ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries
5ec5d38: ACPI: make some IO ports off-limits to AML
3e0676a: ACPICA: add debug dump of BIOS _OSI strings
f3b39f1: ACPI: proc_dir_entry 'video/VGA' already registered
0a3db1c: ACPI: Skip the first two elements in the _BCL package
31878dd: ACPI: remove BM_RLD access from idle entry path
a2b7b01: ACPI: remove locking from PM1x_STS register reads
2b25c9f: eeepc-laptop: use netlink interface
5740294: eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop
c9ddf8f: eeepc-laptop: Check return values from rfkill_register
b5f6f26: eeepc-laptop: Add support for extended hotkeys
ed6f442: asus-laptop: fix label indentation
12d6f35: asus-laptop: update Kconfig for input layer
034ce90: asus-laptop: hotkeys via the generic input interface
2a7dc0d: asus-laptop: use generic netlink interface
1021e21: asus_acpi: Add R1F support
a9df80c: eeepc-laptop: split eeepc_backlight_exit()
2b190e7: panasonic-laptop: fix X[ ARRAY_SIZE(X) ]
4312495: ACPI: Fix crash on ASUS laptops
5d8b532: ACPI suspend: Fix compilation warnings in drivers/acpi/sleep.c
091d71e: PM: Fix compilation warning in kernel/power/main.c

> Also, I see that Fn-Fx don't seem to be reported via /proc/acpi/events any
> more, or at least I'm seeing no evidence of them via acpi_listen (and, not
> coincidentally, I can't adjust the volume etc. via eeepc-acpi-scripts).
> 
> The only other (significant) change is that I've installed X from Debian
> experimental, though -rc3 and 2.6.28.* seem fine with this. (Oh, and I can
> get UXA to cause OOM quite trivially... several Iceweasel tabs is enough.)
> 
> 
> ¹ Yes, I decided not to include symbol names in the running kernel...
> 
> -- 
> | Darren Salt    | linux or ds at              | nr. Ashington, | Toon
> | RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
> | + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.
> 
> I'll have what the bloke on the floor is having...
> 


> ksymoops 2.4.11 on i686 2.6.29-rc4-eee901.  Options used
>      -V (default)
>      -k /proc/ksyms (default)
>      -l /proc/modules (default)
>      -o /lib/modules/2.6.29-rc4-eee901/ (default)
>      -m /boot/System.map-2.6.29-rc4-eee901 (default)
> 
> Warning: You did not tell me where to find symbol information.  I will
> assume that the log matches the kernel and modules that are running
> right now and I'll use the default options above for symbol resolution.
> If the current kernel and/or modules do not match the log, you can get
> more accurate output by telling me the kernel version and where to find
> map, modules, ksyms etc.  ksymoops -h explains the options.
> 
> Error (regular_file): read_ksyms stat /proc/ksyms failed
> No modules in ksyms, skipping objects
> No ksyms, skipping lsmod
> CPU 1 is now offline
> WARNING: at fs/sysfs/group.c:138 ()
> Pid: 330, comm: pciehpd Not tainted 2.6.29-rc4-eee901 #2
> Call Trace:
>  [<c011fab7>] 0xc011fab7
>  [<c032ca9d>] 0xc032ca9d
>  [<f81760d5>] 0xf81760d5
>  [<c01f112c>] 0xc01f112c
>  [<c0118940>] 0xc0118940
>  [<c011fc82>] 0xc011fc82
>  [<c016b8aa>] 0xc016b8aa
>  [<c0190b6b>] 0xc0190b6b
>  [<c016b9a8>] 0xc016b9a8
>  [<c016b738>] 0xc016b738
>  [<c019102a>] 0xc019102a
>  [<c0191faa>] 0xc0191faa
>  [<c025a8d4>] 0xc025a8d4
>  [<c025a9c9>] 0xc025a9c9
>  [<c01fae3c>] 0xc01fae3c
>  [<c01faf00>] 0xc01faf00
>  [<c0205ca4>] 0xc0205ca4
>  [<c0204a68>] 0xc0204a68
>  [<c0204eb3>] 0xc0204eb3
>  [<c0204e2d>] 0xc0204e2d
>  [<c012bd8f>] 0xc012bd8f
>  [<c012c51d>] 0xc012c51d
>  [<c012c5d1>] 0xc012c5d1
>  [<c012e9ac>] 0xc012e9ac
>  [<c012c51d>] 0xc012c51d
>  [<c012e8de>] 0xc012e8de
>  [<c012e8a6>] 0xc012e8a6
>  [<c010349b>] 0xc010349b
> BUG: unable to handle kernel NULL pointer dereference at 00000010
> *pde = 00000000 
> Oops: 0000 [#1] PREEMPT SMP 
> Pid: 330, comm: pciehpd Tainted: G        W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c03ccef7>] EFLAGS: 00010246 CPU: 0
> Using defaults from ksymoops -t elf32-i386 -a i386
> EAX: 00000000 EBX: 00000001 ECX: 00000046 EDX: 00000001
> ESI: f17dd470 EDI: f70f7c5c EBP: 00000000 ESP: f7339f00
>  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
>  f17dd45c 00000000 f70f7c5c c025a9c9 f7060b40 f7311a80ff 83 c0 89 83 cf db 74 19 f6 06 01 74 11 6a 00 ---[ end trace 449537779ba90603 ]---
> Warning (Oops_read): Code line not seen, dumping what data is available
> 
> 
> Trace; c011fab7 <warn_slowpath+7d/94>
> Trace; c032ca9d <__alloc_skb+4b/103>
> Trace; f81760d5 <END_OF_CODE+37c160d5/????>
> Trace; c01f112c <cpumask_next_and+23/33>
> Trace; c0118940 <find_busiest_group+242/725>
> Trace; c011fc82 <__call_console_drivers+51/5d>
> Trace; c016b8aa <find_inode+1b/56>
> Trace; c0190b6b <sysfs_ilookup_test+0/d>
> Trace; c016b9a8 <ifind+3a/74>
> Trace; c016b738 <iput+21/4a>
> Trace; c019102a <sysfs_addrm_finish+4a/1ae>
> Trace; c0191faa <sysfs_remove_group+34/8d>
> Trace; c025a8d4 <device_del+32/11f>
> Trace; c025a9c9 <device_unregister+8/10>
> Trace; c01fae3c <pci_stop_dev+20/3a>
> Trace; c01faf00 <pci_remove_bus_device+27/88>
> Trace; c0205ca4 <pciehp_unconfigure_device+108/180>
> Trace; c0204a68 <pciehp_disable_slot+12d/1d6>
> Trace; c0204eb3 <pciehp_power_thread+86/cd>
> Trace; c0204e2d <pciehp_power_thread+0/cd>
> Trace; c012bd8f <run_workqueue+71/f1>
> Trace; c012c51d <worker_thread+0/bf>
> Trace; c012c5d1 <worker_thread+b4/bf>
> Trace; c012e9ac <autoremove_wake_function+0/2b>
> Trace; c012c51d <worker_thread+0/bf>
> Trace; c012e8de <kthread+38/5e>
> Trace; c012e8a6 <kthread+0/5e>
> Trace; c010349b <kernel_thread_helper+7/10>
> 
> >>EIP; c03ccef7 <klist_put+f/59>   <=====
> 
> BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#2] PREEMPT SMP 
> Pid: 4094, comm: bash Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015bb0a>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: c04c7d90 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000282 EDI: c04c7d90 EBP: 00000040 ESP: ee9f1e38
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000080d0 f173f7c0 c194c488 7ac532a8 fe280a2e c194c488 c0194004
>  f173f7c0 c194c488 f6e64498 0000003e f6e02458 c019aaa0 c194c488 00000000
>  ee949600 c194cff8 00000000 ee949600 ee949600 f6e02458 00000000 c019ab55
> Call Trace:
>  [<c0194004>] 0xc0194004
>  [<c019aaa0>] 0xc019aaa0
>  [<c019ab55>] 0xc019ab55
>  [<c01405ce>] 0xc01405ce
>  [<c0102cf1>] 0xc0102cf1
> 56 BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#3] PREEMPT SMP 
> Pid: 3147, comm: xfce4-systemloa Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: 00000292 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000040 EDI: c018d53c EBP: c04c7d90 ESP: f16ebe34
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 f702c00a ee949300 f73e35e0 c018d53c 00000000 c017059b
>  00000000 f73e35e0 fffffff4 c018d53c ee949300 c0170678 00000000 f7029000
>  fffffff4 00001000 ee949300 c018d51e f173f2a0 f70e9680 c018d4d0 f70e96cc
> Call Trace:
>  [<c018d53c>] 0xc018d53c
>  [<c017059b>] 0xc017059b
>  [<c018d53c>] 0xc018d53c
>  [<c0170678>] 0xc0170678
>  [<c018d51e>] 0xc018d51e
>  [<c018d4d0>] 0xc018d4d0
>  [<c01887b8>] 0xc01887b8
>  [<c017006d>] 0xc017006d
>  [<c012e9ac>] 0xc012e9ac
>  [<c0102cf1>] 0xc0102cf1
> BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#4] PREEMPT SMP 
> Pid: 3137, comm: xfce4-panel Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: 00000296 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000040 EDI: ee939f7c EBP: c04c7d90 ESP: f1653ecc
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 00000000 ee814440 00000000 ee939f7c 01200011 c012c900
>  ee938380 eea4fff8 c048d53c ee814440 c0101a87 01200011 ee814440 00000000
>  ee939f7c ee814440 00000000 ee939f7c 01200011 c011e9cb f1653fb8 bf9e8d30
> Call Trace:
>  [<c012c900>] 0xc012c900
>  [<c0101a87>] 0xc0101a87
>  [<c011e9cb>] 0xc011e9cb
>  [<c011f085>] 0xc011f085
> eb BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#5] PREEMPT SMP 
> Pid: 2942, comm: Xorg Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015bb0a>] EFLAGS: 00213006 CPU: 1
> EAX: 00000000 EBX: c04c7d90 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00203282 EDI: c04c7d90 EBP: 00000040 ESP: f68adef4
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 00203286 00000000 fffffff4 40286454 f6a86800 f81ea6f4
>  f6b2d420 f8348c59 f83583e4 f6950080 bfbc1eb4 40286454 c0167680 bfbc1eb4
>  f6950080 f6f1e7f8 08a84b40 f68ac000 c0167bb4 0000000d 00203082 f68adf9c
> Call Trace:
>  [<f81ea6f4>] 0xf81ea6f4
>  [<f8348c59>] 0xf8348c59
>  [<c0167680>] 0xc0167680
>  [<c0167bb4>] 0xc0167bb4
>  [<c0122ac3>] 0xc0122ac3
>  [<c0122c59>] 0xc0122c59
> f4 BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#6] PREEMPT SMP 
> Pid: 1219, comm: udevd Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: 00000292 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000040 EDI: c018d53c EBP: c04c7d90 ESP: f68fbe34
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 f708c00a ee949c80 f73e3720 c018d53c 00000000 c017059b
>  f6c12964 f73e3720 fffffff4 c018d53c ee949c80 c0170678 00000000 f708e000
>  fffffff4 00001000 ee949c80 c018d51e f173fa20 f70e9680 c018d4d0 f70e96cc
> Call Trace:
>  [<c018d53c>] 0xc018d53c
>  [<c017059b>] 0xc017059b
>  [<c018d53c>] 0xc018d53c
>  [<c0170678>] 0xc0170678
> Warning (Oops_read): Code line not seen, dumping what data is available
> 
> 
> >>EIP; c015bb0a <__kmalloc+83/c0>   <=====
> 
> >>EBX; c04c7d90 <kmalloc_caches+210/480>
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EDI; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c0194004 <ext3_htree_store_dirent+26/de>
> Trace; c019aaa0 <htree_dirblock_to_tree+d6/11b>
> Trace; c019ab55 <ext3_htree_fill_tree+70/1cb>
> Trace; c01405ce <find_lock_page+10/43>
> Trace; c0102cf1 <sysenter_do_call+12/25>
> 
> >>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====
> 
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EDI; c018d53c <show_stat+0/680>
> >>EBP; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c018d53c <show_stat+0/680>
> Trace; c017059b <seq_open+23/6d>
> Trace; c018d53c <show_stat+0/680>
> Trace; c0170678 <single_open+48/68>
> Trace; c018d51e <stat_open+4e/6c>
> Trace; c018d4d0 <stat_open+0/6c>
> Trace; c01887b8 <proc_reg_open+89/ed>
> Trace; c017006d <single_release+0/1b>
> Trace; c012e9ac <autoremove_wake_function+0/2b>
> Trace; c0102cf1 <sysenter_do_call+12/25>
> 
> >>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====
> 
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EBP; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c012c900 <alloc_pid+18/2b6>
> Trace; c0101a87 <copy_thread+2f/f3>
> Trace; c011e9cb <copy_process+917/e42>
> Trace; c011f085 <do_fork+11a/268>
> 
> >>EIP; c015bb0a <__kmalloc+83/c0>   <=====
> 
> >>EBX; c04c7d90 <kmalloc_caches+210/480>
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>ESI; 00203282 <phys_startup_32+103282/c0000000>
> >>EDI; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; f81ea6f4 <END_OF_CODE+37c8a6f4/????>
> Trace; f8348c59 <END_OF_CODE+37de8c59/????>
> Trace; c0167680 <vfs_ioctl+47/5d>
> Trace; c0167bb4 <do_vfs_ioctl+446/47c>
> Trace; c0122ac3 <do_setitimer+157/2a9>
> Trace; c0122c59 <sys_setitimer+44/71>
> 
> >>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====
> 
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EDI; c018d53c <show_stat+0/680>
> >>EBP; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c018d53c <show_stat+0/680>
> Trace; c017059b <seq_open+23/6d>
> Trace; c018d53c <show_stat+0/680>
> Trace; c0170678 <single_open+48/68>
> 
> 
> 3 warnings and 1 error issued.  Results may not be reliable.


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-09 23:49     ` Ingo Molnar
  0 siblings, 0 replies; 50+ messages in thread
From: Ingo Molnar @ 2009-02-09 23:49 UTC (permalink / raw)
  To: linux-kernel, linux-acpi, linux, Rafael J. Wysocki, Len Brown,
	Linus Torvalds, Andrew Morton, Jesse Barnes, Thomas Gleixner,
	H. Peter Anvin


* Darren Salt <linux@youmustbejoking.demon.co.uk> wrote:

> I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
> (captured via netconsole) and decoded oops data attached ¹. The last few
> oopses were followed by a scrambled display and a hard lockup.
> 
> All oopses follow an otherwise successful suspend-to-RAM.

Various folks Cc:-ed. There's been a late, rather large ACPI merge, so
one post-rc3 suspect would be one of these commits:

f12b12a: Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
2d29c6a: Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec', 'misc', 'printk' and 'processor' into release
370154b: ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name.
7695fb0: eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init
386e4a8: ACPICA: Fix table entry truncation calculation
d96f94c: ACPI: Enable bit 11 in _PDC to advertise hw coord
db1461a: ACPI: struct device - replace bus_id with dev_name(), dev_set_name()
4d93915: ACPI: add missing KERN_* constants to printks
fc5a9f8: ACPI: dock: Don't eval _STA on every show_docked sysfs read
9e3a9d1: ACPI: disable ACPI cleanly when bad RSDP found
9fdd54f: ACPI: delete CPU_IDLE=n code
62663ea: ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries
5ec5d38: ACPI: make some IO ports off-limits to AML
3e0676a: ACPICA: add debug dump of BIOS _OSI strings
f3b39f1: ACPI: proc_dir_entry 'video/VGA' already registered
0a3db1c: ACPI: Skip the first two elements in the _BCL package
31878dd: ACPI: remove BM_RLD access from idle entry path
a2b7b01: ACPI: remove locking from PM1x_STS register reads
2b25c9f: eeepc-laptop: use netlink interface
5740294: eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop
c9ddf8f: eeepc-laptop: Check return values from rfkill_register
b5f6f26: eeepc-laptop: Add support for extended hotkeys
ed6f442: asus-laptop: fix label indentation
12d6f35: asus-laptop: update Kconfig for input layer
034ce90: asus-laptop: hotkeys via the generic input interface
2a7dc0d: asus-laptop: use generic netlink interface
1021e21: asus_acpi: Add R1F support
a9df80c: eeepc-laptop: split eeepc_backlight_exit()
2b190e7: panasonic-laptop: fix X[ ARRAY_SIZE(X) ]
4312495: ACPI: Fix crash on ASUS laptops
5d8b532: ACPI suspend: Fix compilation warnings in drivers/acpi/sleep.c
091d71e: PM: Fix compilation warning in kernel/power/main.c

> Also, I see that Fn-Fx don't seem to be reported via /proc/acpi/events any
> more, or at least I'm seeing no evidence of them via acpi_listen (and, not
> coincidentally, I can't adjust the volume etc. via eeepc-acpi-scripts).
> 
> The only other (significant) change is that I've installed X from Debian
> experimental, though -rc3 and 2.6.28.* seem fine with this. (Oh, and I can
> get UXA to cause OOM quite trivially... several Iceweasel tabs is enough.)
> 
> 
> ¹ Yes, I decided not to include symbol names in the running kernel...
> 
> -- 
> | Darren Salt    | linux or ds at              | nr. Ashington, | Toon
> | RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
> | + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.
> 
> I'll have what the bloke on the floor is having...
> 


> ksymoops 2.4.11 on i686 2.6.29-rc4-eee901.  Options used
>      -V (default)
>      -k /proc/ksyms (default)
>      -l /proc/modules (default)
>      -o /lib/modules/2.6.29-rc4-eee901/ (default)
>      -m /boot/System.map-2.6.29-rc4-eee901 (default)
> 
> Warning: You did not tell me where to find symbol information.  I will
> assume that the log matches the kernel and modules that are running
> right now and I'll use the default options above for symbol resolution.
> If the current kernel and/or modules do not match the log, you can get
> more accurate output by telling me the kernel version and where to find
> map, modules, ksyms etc.  ksymoops -h explains the options.
> 
> Error (regular_file): read_ksyms stat /proc/ksyms failed
> No modules in ksyms, skipping objects
> No ksyms, skipping lsmod
> CPU 1 is now offline
> WARNING: at fs/sysfs/group.c:138 ()
> Pid: 330, comm: pciehpd Not tainted 2.6.29-rc4-eee901 #2
> Call Trace:
>  [<c011fab7>] 0xc011fab7
>  [<c032ca9d>] 0xc032ca9d
>  [<f81760d5>] 0xf81760d5
>  [<c01f112c>] 0xc01f112c
>  [<c0118940>] 0xc0118940
>  [<c011fc82>] 0xc011fc82
>  [<c016b8aa>] 0xc016b8aa
>  [<c0190b6b>] 0xc0190b6b
>  [<c016b9a8>] 0xc016b9a8
>  [<c016b738>] 0xc016b738
>  [<c019102a>] 0xc019102a
>  [<c0191faa>] 0xc0191faa
>  [<c025a8d4>] 0xc025a8d4
>  [<c025a9c9>] 0xc025a9c9
>  [<c01fae3c>] 0xc01fae3c
>  [<c01faf00>] 0xc01faf00
>  [<c0205ca4>] 0xc0205ca4
>  [<c0204a68>] 0xc0204a68
>  [<c0204eb3>] 0xc0204eb3
>  [<c0204e2d>] 0xc0204e2d
>  [<c012bd8f>] 0xc012bd8f
>  [<c012c51d>] 0xc012c51d
>  [<c012c5d1>] 0xc012c5d1
>  [<c012e9ac>] 0xc012e9ac
>  [<c012c51d>] 0xc012c51d
>  [<c012e8de>] 0xc012e8de
>  [<c012e8a6>] 0xc012e8a6
>  [<c010349b>] 0xc010349b
> BUG: unable to handle kernel NULL pointer dereference at 00000010
> *pde = 00000000 
> Oops: 0000 [#1] PREEMPT SMP 
> Pid: 330, comm: pciehpd Tainted: G        W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c03ccef7>] EFLAGS: 00010246 CPU: 0
> Using defaults from ksymoops -t elf32-i386 -a i386
> EAX: 00000000 EBX: 00000001 ECX: 00000046 EDX: 00000001
> ESI: f17dd470 EDI: f70f7c5c EBP: 00000000 ESP: f7339f00
>  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
>  f17dd45c 00000000 f70f7c5c c025a9c9 f7060b40 f7311a80ff 83 c0 89 83 cf db 74 19 f6 06 01 74 11 6a 00 ---[ end trace 449537779ba90603 ]---
> Warning (Oops_read): Code line not seen, dumping what data is available
> 
> 
> Trace; c011fab7 <warn_slowpath+7d/94>
> Trace; c032ca9d <__alloc_skb+4b/103>
> Trace; f81760d5 <END_OF_CODE+37c160d5/????>
> Trace; c01f112c <cpumask_next_and+23/33>
> Trace; c0118940 <find_busiest_group+242/725>
> Trace; c011fc82 <__call_console_drivers+51/5d>
> Trace; c016b8aa <find_inode+1b/56>
> Trace; c0190b6b <sysfs_ilookup_test+0/d>
> Trace; c016b9a8 <ifind+3a/74>
> Trace; c016b738 <iput+21/4a>
> Trace; c019102a <sysfs_addrm_finish+4a/1ae>
> Trace; c0191faa <sysfs_remove_group+34/8d>
> Trace; c025a8d4 <device_del+32/11f>
> Trace; c025a9c9 <device_unregister+8/10>
> Trace; c01fae3c <pci_stop_dev+20/3a>
> Trace; c01faf00 <pci_remove_bus_device+27/88>
> Trace; c0205ca4 <pciehp_unconfigure_device+108/180>
> Trace; c0204a68 <pciehp_disable_slot+12d/1d6>
> Trace; c0204eb3 <pciehp_power_thread+86/cd>
> Trace; c0204e2d <pciehp_power_thread+0/cd>
> Trace; c012bd8f <run_workqueue+71/f1>
> Trace; c012c51d <worker_thread+0/bf>
> Trace; c012c5d1 <worker_thread+b4/bf>
> Trace; c012e9ac <autoremove_wake_function+0/2b>
> Trace; c012c51d <worker_thread+0/bf>
> Trace; c012e8de <kthread+38/5e>
> Trace; c012e8a6 <kthread+0/5e>
> Trace; c010349b <kernel_thread_helper+7/10>
> 
> >>EIP; c03ccef7 <klist_put+f/59>   <=====
> 
> BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#2] PREEMPT SMP 
> Pid: 4094, comm: bash Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015bb0a>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: c04c7d90 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000282 EDI: c04c7d90 EBP: 00000040 ESP: ee9f1e38
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000080d0 f173f7c0 c194c488 7ac532a8 fe280a2e c194c488 c0194004
>  f173f7c0 c194c488 f6e64498 0000003e f6e02458 c019aaa0 c194c488 00000000
>  ee949600 c194cff8 00000000 ee949600 ee949600 f6e02458 00000000 c019ab55
> Call Trace:
>  [<c0194004>] 0xc0194004
>  [<c019aaa0>] 0xc019aaa0
>  [<c019ab55>] 0xc019ab55
>  [<c01405ce>] 0xc01405ce
>  [<c0102cf1>] 0xc0102cf1
> 56 BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#3] PREEMPT SMP 
> Pid: 3147, comm: xfce4-systemloa Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: 00000292 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000040 EDI: c018d53c EBP: c04c7d90 ESP: f16ebe34
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 f702c00a ee949300 f73e35e0 c018d53c 00000000 c017059b
>  00000000 f73e35e0 fffffff4 c018d53c ee949300 c0170678 00000000 f7029000
>  fffffff4 00001000 ee949300 c018d51e f173f2a0 f70e9680 c018d4d0 f70e96cc
> Call Trace:
>  [<c018d53c>] 0xc018d53c
>  [<c017059b>] 0xc017059b
>  [<c018d53c>] 0xc018d53c
>  [<c0170678>] 0xc0170678
>  [<c018d51e>] 0xc018d51e
>  [<c018d4d0>] 0xc018d4d0
>  [<c01887b8>] 0xc01887b8
>  [<c017006d>] 0xc017006d
>  [<c012e9ac>] 0xc012e9ac
>  [<c0102cf1>] 0xc0102cf1
> BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#4] PREEMPT SMP 
> Pid: 3137, comm: xfce4-panel Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: 00000296 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000040 EDI: ee939f7c EBP: c04c7d90 ESP: f1653ecc
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 00000000 ee814440 00000000 ee939f7c 01200011 c012c900
>  ee938380 eea4fff8 c048d53c ee814440 c0101a87 01200011 ee814440 00000000
>  ee939f7c ee814440 00000000 ee939f7c 01200011 c011e9cb f1653fb8 bf9e8d30
> Call Trace:
>  [<c012c900>] 0xc012c900
>  [<c0101a87>] 0xc0101a87
>  [<c011e9cb>] 0xc011e9cb
>  [<c011f085>] 0xc011f085
> eb BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#5] PREEMPT SMP 
> Pid: 2942, comm: Xorg Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015bb0a>] EFLAGS: 00213006 CPU: 1
> EAX: 00000000 EBX: c04c7d90 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00203282 EDI: c04c7d90 EBP: 00000040 ESP: f68adef4
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 00203286 00000000 fffffff4 40286454 f6a86800 f81ea6f4
>  f6b2d420 f8348c59 f83583e4 f6950080 bfbc1eb4 40286454 c0167680 bfbc1eb4
>  f6950080 f6f1e7f8 08a84b40 f68ac000 c0167bb4 0000000d 00203082 f68adf9c
> Call Trace:
>  [<f81ea6f4>] 0xf81ea6f4
>  [<f8348c59>] 0xf8348c59
>  [<c0167680>] 0xc0167680
>  [<c0167bb4>] 0xc0167bb4
>  [<c0122ac3>] 0xc0122ac3
>  [<c0122c59>] 0xc0122c59
> f4 BUG: unable to handle kernel paging request at 7a9d5f5c
> *pde = 00000000 
> Oops: 0000 [#6] PREEMPT SMP 
> Pid: 1219, comm: udevd Tainted: G      D W  (2.6.29-rc4-eee901 #2) 901
> EIP: 0060:[<c015b4e5>] EFLAGS: 00010006 CPU: 1
> EAX: 00000000 EBX: 00000292 ECX: 7a9d5f5c EDX: c180ff6c
> ESI: 00000040 EDI: c018d53c EBP: c04c7d90 ESP: f68fbe34
>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>  7a9d5f5c 000000d0 f708c00a ee949c80 f73e3720 c018d53c 00000000 c017059b
>  f6c12964 f73e3720 fffffff4 c018d53c ee949c80 c0170678 00000000 f708e000
>  fffffff4 00001000 ee949c80 c018d51e f173fa20 f70e9680 c018d4d0 f70e96cc
> Call Trace:
>  [<c018d53c>] 0xc018d53c
>  [<c017059b>] 0xc017059b
>  [<c018d53c>] 0xc018d53c
>  [<c0170678>] 0xc0170678
> Warning (Oops_read): Code line not seen, dumping what data is available
> 
> 
> >>EIP; c015bb0a <__kmalloc+83/c0>   <=====
> 
> >>EBX; c04c7d90 <kmalloc_caches+210/480>
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EDI; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c0194004 <ext3_htree_store_dirent+26/de>
> Trace; c019aaa0 <htree_dirblock_to_tree+d6/11b>
> Trace; c019ab55 <ext3_htree_fill_tree+70/1cb>
> Trace; c01405ce <find_lock_page+10/43>
> Trace; c0102cf1 <sysenter_do_call+12/25>
> 
> >>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====
> 
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EDI; c018d53c <show_stat+0/680>
> >>EBP; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c018d53c <show_stat+0/680>
> Trace; c017059b <seq_open+23/6d>
> Trace; c018d53c <show_stat+0/680>
> Trace; c0170678 <single_open+48/68>
> Trace; c018d51e <stat_open+4e/6c>
> Trace; c018d4d0 <stat_open+0/6c>
> Trace; c01887b8 <proc_reg_open+89/ed>
> Trace; c017006d <single_release+0/1b>
> Trace; c012e9ac <autoremove_wake_function+0/2b>
> Trace; c0102cf1 <sysenter_do_call+12/25>
> 
> >>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====
> 
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EBP; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c012c900 <alloc_pid+18/2b6>
> Trace; c0101a87 <copy_thread+2f/f3>
> Trace; c011e9cb <copy_process+917/e42>
> Trace; c011f085 <do_fork+11a/268>
> 
> >>EIP; c015bb0a <__kmalloc+83/c0>   <=====
> 
> >>EBX; c04c7d90 <kmalloc_caches+210/480>
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>ESI; 00203282 <phys_startup_32+103282/c0000000>
> >>EDI; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; f81ea6f4 <END_OF_CODE+37c8a6f4/????>
> Trace; f8348c59 <END_OF_CODE+37de8c59/????>
> Trace; c0167680 <vfs_ioctl+47/5d>
> Trace; c0167bb4 <do_vfs_ioctl+446/47c>
> Trace; c0122ac3 <do_setitimer+157/2a9>
> Trace; c0122c59 <sys_setitimer+44/71>
> 
> >>EIP; c015b4e5 <kmem_cache_alloc+48/83>   <=====
> 
> >>ECX; 7a9d5f5c <phys_startup_32+7a8d5f5c/c0000000>
> >>EDI; c018d53c <show_stat+0/680>
> >>EBP; c04c7d90 <kmalloc_caches+210/480>
> 
> Trace; c018d53c <show_stat+0/680>
> Trace; c017059b <seq_open+23/6d>
> Trace; c018d53c <show_stat+0/680>
> Trace; c0170678 <single_open+48/68>
> 
> 
> 3 warnings and 1 error issued.  Results may not be reliable.



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-09 18:26 ` Oopses and ACPI problems (Linus 2.6.29-rc4) Darren Salt
@ 2009-02-10  1:06     ` yakui_zhao
  2009-02-10  1:06     ` yakui_zhao
  1 sibling, 0 replies; 50+ messages in thread
From: yakui_zhao @ 2009-02-10  1:06 UTC (permalink / raw)
  To: Darren Salt; +Cc: linux-kernel, linux-acpi

On Tue, 2009-02-10 at 02:26 +0800, Darren Salt wrote:
> I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
> (captured via netconsole) and decoded oops data attached ¹. The last few
> oopses were followed by a scrambled display and a hard lockup.
> 
> All oopses follow an otherwise successful suspend-to-RAM.
> 
> Also, I see that Fn-Fx don't seem to be reported via /proc/acpi/events any
> more, or at least I'm seeing no evidence of them via acpi_listen (and, not
> coincidentally, I can't adjust the volume etc. via eeepc-acpi-scripts).
> 
> The only other (significant) change is that I've installed X from Debian
> experimental, though -rc3 and 2.6.28.* seem fine with this. (Oh, and I can
> get UXA to cause OOM quite trivially... several Iceweasel tabs is enough.)
> 
>From the description it seems that this is a regression. 
Will you please use git-bisect to identify which commit causes the
regression?
   Thanks.
> 
> ¹ Yes, I decided not to include symbol names in the running kernel...
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-10  1:06     ` yakui_zhao
  0 siblings, 0 replies; 50+ messages in thread
From: yakui_zhao @ 2009-02-10  1:06 UTC (permalink / raw)
  To: Darren Salt; +Cc: linux-kernel, linux-acpi

On Tue, 2009-02-10 at 02:26 +0800, Darren Salt wrote:
> I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
> (captured via netconsole) and decoded oops data attached ¹. The last few
> oopses were followed by a scrambled display and a hard lockup.
> 
> All oopses follow an otherwise successful suspend-to-RAM.
> 
> Also, I see that Fn-Fx don't seem to be reported via /proc/acpi/events any
> more, or at least I'm seeing no evidence of them via acpi_listen (and, not
> coincidentally, I can't adjust the volume etc. via eeepc-acpi-scripts).
> 
> The only other (significant) change is that I've installed X from Debian
> experimental, though -rc3 and 2.6.28.* seem fine with this. (Oh, and I can
> get UXA to cause OOM quite trivially... several Iceweasel tabs is enough.)
> 
>From the description it seems that this is a regression. 
Will you please use git-bisect to identify which commit causes the
regression?
   Thanks.
> 
> ¹ Yes, I decided not to include symbol names in the running kernel...
> 


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-08 21:01 Linus 2.6.29-rc4 Linus Torvalds
                   ` (2 preceding siblings ...)
  2009-02-09 18:26 ` Oopses and ACPI problems (Linus 2.6.29-rc4) Darren Salt
@ 2009-02-10 14:02 ` Mel Gorman
  2009-02-10 23:45   ` Andrew Morton
  2009-02-11  9:43   ` Andy Whitcroft
  3 siblings, 2 replies; 50+ messages in thread
From: Mel Gorman @ 2009-02-10 14:02 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel Mailing List, KOSAKI Motohiro, Hugh Dickins,
	Lee Schermerhorn, Greg KH, Maksim Yevmenkin, Nick Piggin,
	Andrew Morton, will, Rik van Riel, KAMEZAWA Hiroyuki,
	Mikos Szeredi, Andy Whitcroft, wli

On Sun, Feb 08, 2009 at 01:01:04PM -0800, Linus Torvalds wrote:
> 
> Another week (and a half), another -rc.
> 
> Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> updates, FS updates (ubifs, btrfs), you name it. It's all there.
> 
> But more importantly, people really have been working on regressions, and 
> hopefully this closes a nice set of the top one, and hopefully without 
> introducing too many new ones.
> 

Hugepages are currently busted due to commit
fc8744adc870a8d4366908221508bb113d8b72ee and the problem is in
2.6.29-rc4. There was a bit of a discussion but it didn't get very far and
then I went offline for the weekend. Here is a revised patch that tries to
bring hugetlbfs more in line with what the core VM is doing by dealing with
VM_ACCOUNT and VM_NORESERVE.

=============
Do not account for the address space used by hugetlbfs using VM_ACCOUNT

When overcommit is disabled, the core VM accounts for pages used by anonymous
shared, private mappings and special mappings. It keeps track of VMAs that
should be accounted for with VM_ACCOUNT and VMAs that never had a reserve
with VM_NORESERVE.

Overcommit for hugetlbfs is much riskier than overcommit for base pages
due to contiguity requirements. It avoids overcommiting on both shared and
private mappings using reservation counters that are checked and updated
during mmap(). This ensures (within limits) that hugepages exist in the
future when faults occurs or it is too easy to applications to be SIGKILLed.

As hugetlbfs makes its own reservations of a different unit to the base page
size, VM_ACCOUNT should never be set. Even if the units were correct, we would
double account for the usage in the core VM and hugetlbfs. VM_NORESERVE may
be set because an application can request no reserves be made for hugetlbfs
at the risk of getting killed later.

With commit fc8744adc870a8d4366908221508bb113d8b72ee, VM_NORESERVE and
VM_ACCOUNT are getting unconditionally set for hugetlbfs-backed mappings. This
breaks the accounting for both the core VM and hugetlbfs, can trigger an
OOM storm when hugepage pools are too small lockups and corrupted counters
otherwise are used. This patch brings hugetlbfs more in line with how the
core VM treats VM_NORESERVE but prevents VM_ACCOUNT being set.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
--- 
 fs/hugetlbfs/inode.c    |    8 +++++---
 include/linux/hugetlb.h |    5 +++--
 include/linux/mm.h      |    3 +--
 ipc/shm.c               |    8 +++++---
 mm/fremap.c             |    2 +-
 mm/hugetlb.c            |   39 +++++++++++++++++++++++++--------------
 mm/mmap.c               |   38 ++++++++++++++++++++++----------------
 mm/mprotect.c           |    5 +++--
 8 files changed, 65 insertions(+), 43 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 6903d37..9b800d9 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -108,7 +108,8 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
 
 	if (hugetlb_reserve_pages(inode,
 				vma->vm_pgoff >> huge_page_order(h),
-				len >> huge_page_shift(h), vma))
+				len >> huge_page_shift(h), vma,
+				vma->vm_flags))
 		goto out;
 
 	ret = 0;
@@ -947,7 +948,7 @@ static int can_do_hugetlb_shm(void)
 			can_do_mlock());
 }
 
-struct file *hugetlb_file_setup(const char *name, size_t size)
+struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
 {
 	int error = -ENOMEM;
 	struct file *file;
@@ -981,7 +982,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size)
 
 	error = -ENOMEM;
 	if (hugetlb_reserve_pages(inode, 0,
-			size >> huge_page_shift(hstate_inode(inode)), NULL))
+			size >> huge_page_shift(hstate_inode(inode)), NULL,
+			acctflag))
 		goto out_inode;
 
 	d_instantiate(dentry, inode);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f1d2fba..af09660 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -33,7 +33,8 @@ unsigned long hugetlb_total_pages(void);
 int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 			unsigned long address, int write_access);
 int hugetlb_reserve_pages(struct inode *inode, long from, long to,
-						struct vm_area_struct *vma);
+						struct vm_area_struct *vma,
+						int acctflags);
 void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
 
 extern unsigned long hugepages_treat_as_movable;
@@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
 
 extern const struct file_operations hugetlbfs_file_operations;
 extern struct vm_operations_struct hugetlb_vm_ops;
-struct file *hugetlb_file_setup(const char *name, size_t);
+struct file *hugetlb_file_setup(const char *name, size_t, int);
 int hugetlb_get_quota(struct address_space *mapping, long delta);
 void hugetlb_put_quota(struct address_space *mapping, long delta);
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e8ddc98..3235615 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1129,8 +1129,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 	unsigned long flag, unsigned long pgoff);
 extern unsigned long mmap_region(struct file *file, unsigned long addr,
 	unsigned long len, unsigned long flags,
-	unsigned int vm_flags, unsigned long pgoff,
-	int accountable);
+	unsigned int vm_flags, unsigned long pgoff);
 
 static inline unsigned long do_mmap(struct file *file, unsigned long addr,
 	unsigned long len, unsigned long prot,
diff --git a/ipc/shm.c b/ipc/shm.c
index f8f69fa..05d51d2 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -340,6 +340,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
 	struct file * file;
 	char name[13];
 	int id;
+	int acctflag = 0;
 
 	if (size < SHMMIN || size > ns->shm_ctlmax)
 		return -EINVAL;
@@ -364,11 +365,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
 
 	sprintf (name, "SYSV%08x", key);
 	if (shmflg & SHM_HUGETLB) {
-		/* hugetlb_file_setup takes care of mlock user accounting */
-		file = hugetlb_file_setup(name, size);
+		/* hugetlb_file_setup applies strict accounting */
+		if (shmflg & SHM_NORESERVE)
+			acctflag = VM_NORESERVE;
+		file = hugetlb_file_setup(name, size, acctflag);
 		shp->mlock_user = current_user();
 	} else {
-		int acctflag = 0;
 		/*
 		 * Do not allow no accounting for OVERCOMMIT_NEVER, even
 	 	 * if it's asked for.
diff --git a/mm/fremap.c b/mm/fremap.c
index 736ba7f..b6ec85a 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -198,7 +198,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
 			flags &= MAP_NONBLOCK;
 			get_file(file);
 			addr = mmap_region(file, start, size,
-					flags, vma->vm_flags, pgoff, 1);
+					flags, vma->vm_flags, pgoff);
 			fput(file);
 			if (IS_ERR_VALUE(addr)) {
 				err = addr;
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 618e983..2074642 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2269,14 +2269,12 @@ void hugetlb_change_protection(struct vm_area_struct *vma,
 
 int hugetlb_reserve_pages(struct inode *inode,
 					long from, long to,
-					struct vm_area_struct *vma)
+					struct vm_area_struct *vma,
+					int acctflag)
 {
-	long ret, chg;
+	long ret = 0, chg;
 	struct hstate *h = hstate_inode(inode);
 
-	if (vma && vma->vm_flags & VM_NORESERVE)
-		return 0;
-
 	/*
 	 * Shared mappings base their reservation on the number of pages that
 	 * are already allocated on behalf of the file. Private mappings need
@@ -2285,22 +2283,25 @@ int hugetlb_reserve_pages(struct inode *inode,
 	 */
 	if (!vma || vma->vm_flags & VM_SHARED)
 		chg = region_chg(&inode->i_mapping->private_list, from, to);
-	else {
-		struct resv_map *resv_map = resv_map_alloc();
-		if (!resv_map)
-			return -ENOMEM;
-
+	else
 		chg = to - from;
 
-		set_vma_resv_map(vma, resv_map);
-		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
-	}
-
 	if (chg < 0)
 		return chg;
 
 	if (hugetlb_get_quota(inode->i_mapping, chg))
 		return -ENOSPC;
+
+	/*
+	 * Only apply hugepage reservation if asked. We still have to
+	 * take the filesystem quota because it is an upper limit
+	 * defined for the mount and not necessarily memory as a whole
+	 */
+	if (acctflag & VM_NORESERVE) {
+		reset_vma_resv_huge_pages(vma);
+		return 0;
+	}
+
 	ret = hugetlb_acct_memory(h, chg);
 	if (ret < 0) {
 		hugetlb_put_quota(inode->i_mapping, chg);
@@ -2308,6 +2309,16 @@ int hugetlb_reserve_pages(struct inode *inode,
 	}
 	if (!vma || vma->vm_flags & VM_SHARED)
 		region_add(&inode->i_mapping->private_list, from, to);
+	else {
+		struct resv_map *resv_map = resv_map_alloc();
+
+		if (!resv_map)
+			return -ENOMEM;
+
+		set_vma_resv_map(vma, resv_map);
+		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
+	}
+
 	return 0;
 }
 
diff --git a/mm/mmap.c b/mm/mmap.c
index 214b6a2..6f70db8 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -918,7 +918,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 	struct inode *inode;
 	unsigned int vm_flags;
 	int error;
-	int accountable = 1;
 	unsigned long reqprot = prot;
 
 	/*
@@ -1019,8 +1018,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 					return -EPERM;
 				vm_flags &= ~VM_MAYEXEC;
 			}
-			if (is_file_hugepages(file))
-				accountable = 0;
 
 			if (!file->f_op || !file->f_op->mmap)
 				return -ENODEV;
@@ -1053,8 +1050,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 	if (error)
 		return error;
 
-	return mmap_region(file, addr, len, flags, vm_flags, pgoff,
-			   accountable);
+	return mmap_region(file, addr, len, flags, vm_flags, pgoff);
 }
 EXPORT_SYMBOL(do_mmap_pgoff);
 
@@ -1092,17 +1088,23 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
 
 /*
  * We account for memory if it's a private writeable mapping,
- * and VM_NORESERVE wasn't set.
+ * not hugepages and VM_NORESERVE wasn't set.
  */
-static inline int accountable_mapping(unsigned int vm_flags)
+static inline int accountable_mapping(struct file *file, unsigned int vm_flags)
 {
+	/*
+	 * hugetlb has its own accounting separate from the core VM
+	 * VM_HUGETLB may not be set yet so we cannot check for that flag.
+	 */
+	if (file && is_file_hugepages(file))
+		return 0;
+
 	return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE;
 }
 
 unsigned long mmap_region(struct file *file, unsigned long addr,
 			  unsigned long len, unsigned long flags,
-			  unsigned int vm_flags, unsigned long pgoff,
-			  int accountable)
+			  unsigned int vm_flags, unsigned long pgoff)
 {
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *vma, *prev;
@@ -1128,18 +1130,22 @@ munmap_back:
 
 	/*
 	 * Set 'VM_NORESERVE' if we should not account for the
-	 * memory use of this mapping. We only honor MAP_NORESERVE
-	 * if we're allowed to overcommit memory.
+	 * memory use of this mapping.
 	 */
-	if ((flags & MAP_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER)
-		vm_flags |= VM_NORESERVE;
-	if (!accountable)
-		vm_flags |= VM_NORESERVE;
+	if ((flags & MAP_NORESERVE)) {
+	 	/* * We honor MAP_NORESERVE if allowed to overcommit */
+		if (sysctl_overcommit_memory != OVERCOMMIT_NEVER)
+			vm_flags |= VM_NORESERVE;
+
+		/* hugetlb applies strict overcommit unless MAP_NORESERVE */
+		if (file && is_file_hugepages(file))
+			vm_flags |= VM_NORESERVE;
+	}
 
 	/*
 	 * Private writable mapping: check memory availability
 	 */
-	if (accountable_mapping(vm_flags)) {
+	if (accountable_mapping(file, vm_flags)) {
 		charged = len >> PAGE_SHIFT;
 		if (security_vm_enough_memory(charged))
 			return -ENOMEM;
diff --git a/mm/mprotect.c b/mm/mprotect.c
index abe2694..258197b 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -151,10 +151,11 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
 	/*
 	 * If we make a private mapping writable we increase our commit;
 	 * but (without finer accounting) cannot reduce our commit if we
-	 * make it unwritable again.
+	 * make it unwritable again. hugetlb mapping were accounted for
+	 * even if read-only so there is no need to account for them here
 	 */
 	if (newflags & VM_WRITE) {
-		if (!(oldflags & (VM_ACCOUNT|VM_WRITE|
+		if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_HUGETLB|
 						VM_SHARED|VM_NORESERVE))) {
 			charged = nrpages;
 			if (security_vm_enough_memory(charged))


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-09 23:49     ` Ingo Molnar
@ 2009-02-10 14:12       ` Darren Salt
  -1 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-10 14:12 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-acpi, Rafael J. Wysocki, Len Brown,
	Linus Torvalds, Andrew Morton, Jesse Barnes, Thomas Gleixner,
	H. Peter Anvin, Matthew Garrett, Corentin Chary

[Adding Matthew Garrett & Corentin Chary to Cc]

I demand that Ingo Molnar may or may not have written...

> * Darren Salt <linux@youmustbejoking.demon.co.uk> wrote:
>> I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
>> (captured via netconsole) and decoded oops data attached ¹. The last few
>> oopses were followed by a scrambled display and a hard lockup.

>> All oopses follow an otherwise successful suspend-to-RAM.

> Various folks Cc:-ed. There's been a late, rather large ACPI merge, so
> one post-rc3 suspect would be one of these commits:

[snip]
> 7695fb0: eeepc-laptop: fix oops when changing backlight brightness during
eeepc-laptop init

No, that one's harmless :-)

[snip]
> 2b25c9f: eeepc-laptop: use netlink interface

That one makes acpid (apparently) useless. The rest of the commit description
is:
    To be prepared for /proc/acpi/event removal we export events
    also through generic netlink interface.

Note that "also". The actual effect of the patch is "instead".

Adding the two removed lines (but removing the post-increment of the event
count) fixes this.

> 5740294: eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop

Reverting this fixes the rfkill oops; things work correctly again. I don't
know why this appears to be needed, since things work fine without this patch
‒ both Fn-F2 and echoing to /sys/class/rfkill/rfkill0/state ‒ even when I
start up with init=/bin/sh and test directly from that shell.

(901; BIOS rev. 1808.)

[snip]
> 2a7dc0d: asus-laptop: use generic netlink interface

That one also says "also" where it should say "instead" (not that it affects
me).

... oh yes, there's a long delay between output of these two lines during
boot:
  input: ETPS/2 Elantech Touchpad as /class/input/input5
  eeepc: Hotkey init flags 0x41
(not seen in .28 or .28.1; not checked later .28.*.)

Anyway, a patch for the ACPI reporting problems will follow this message.

[snip]
-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Output less CO2 => avoid massive flooding.    TIME IS RUNNING OUT *FAST*.

Life is that brief interlude between nothingness and eternity.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-10 14:12       ` Darren Salt
  0 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-10 14:12 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-acpi, Rafael J. Wysocki, Len Brown,
	Linus Torvalds, Andrew Morton, Jesse Barnes, Thomas Gleixner,
	H. Peter Anvin, Matthew Garrett, Corentin Chary

[Adding Matthew Garrett & Corentin Chary to Cc]

I demand that Ingo Molnar may or may not have written...

> * Darren Salt <linux@youmustbejoking.demon.co.uk> wrote:
>> I'm seeing various oopses with -rc4, where -rc3 is fine; config, dmesg
>> (captured via netconsole) and decoded oops data attached ¹. The last few
>> oopses were followed by a scrambled display and a hard lockup.

>> All oopses follow an otherwise successful suspend-to-RAM.

> Various folks Cc:-ed. There's been a late, rather large ACPI merge, so
> one post-rc3 suspect would be one of these commits:

[snip]
> 7695fb0: eeepc-laptop: fix oops when changing backlight brightness during
eeepc-laptop init

No, that one's harmless :-)

[snip]
> 2b25c9f: eeepc-laptop: use netlink interface

That one makes acpid (apparently) useless. The rest of the commit description
is:
    To be prepared for /proc/acpi/event removal we export events
    also through generic netlink interface.

Note that "also". The actual effect of the patch is "instead".

Adding the two removed lines (but removing the post-increment of the event
count) fixes this.

> 5740294: eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop

Reverting this fixes the rfkill oops; things work correctly again. I don't
know why this appears to be needed, since things work fine without this patch
‒ both Fn-F2 and echoing to /sys/class/rfkill/rfkill0/state ‒ even when I
start up with init=/bin/sh and test directly from that shell.

(901; BIOS rev. 1808.)

[snip]
> 2a7dc0d: asus-laptop: use generic netlink interface

That one also says "also" where it should say "instead" (not that it affects
me).

... oh yes, there's a long delay between output of these two lines during
boot:
  input: ETPS/2 Elantech Touchpad as /class/input/input5
  eeepc: Hotkey init flags 0x41
(not seen in .28 or .28.1; not checked later .28.*.)

Anyway, a patch for the ACPI reporting problems will follow this message.

[snip]
-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Output less CO2 => avoid massive flooding.    TIME IS RUNNING OUT *FAST*.

Life is that brief interlude between nothingness and eternity.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 2.6.29-rc4] Restore ACPI reporting via /proc/acpi/events for EeePC & other Asus laptops.
  2009-02-10 14:12       ` Darren Salt
@ 2009-02-10 14:54         ` Darren Salt
  -1 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-10 14:54 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds

The descriptions for the following two commits
  2a7dc0d8c60325e9bf820900bf919430e5a419ab (asus-laptop)
  2b25c9f01aa58d48129b2f93748dfb5d1f7ab0a2 (eeepc-laptop)
say that events should ALSO be exported via netlink, but the effect is that
they are INSTEAD exported via netlink. The latter commit breaks use of acpid
on my EeePC 901.

Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>

diff --git a/drivers/platform/x86/asus-laptop.c
b/drivers/platform/x86/asus-laptop.c
index 56af6cf..42ecf6a 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -832,6 +832,8 @@ static void asus_hotk_notify(acpi_handle handle, u32
event, void *data)
 		lcd_blank(FB_BLANK_POWERDOWN);
 	}
 
+	acpi_bus_generate_proc_event(ehotk->device, event,
+				     ehotk->event_count[event % 128]);
 	acpi_bus_generate_netlink_event(hotk->device->pnp.device_class,
 					dev_name(&hotk->device->dev), event,
 					hotk->event_count[event % 128]++);
diff --git a/drivers/platform/x86/eeepc-laptop.c
b/drivers/platform/x86/eeepc-laptop.c
index 786ed86..8511891 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -561,6 +561,8 @@ static void eeepc_hotk_notify(acpi_handle handle, u32
event, void *data)
 		return;
 	if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
 		notify_brn();
+	acpi_bus_generate_proc_event(ehotk->device, event,
+				     ehotk->event_count[event % 128]);
 	acpi_bus_generate_netlink_event(ehotk->device->pnp.device_class,
 					dev_name(&ehotk->device->dev), event,
 					ehotk->event_count[event % 128]++);

-- 
| Darren Salt    | d @ youmustbejoking,demon,co,uk | nr. Ashington, | Toon
| RISC OS, Linux | s   zap,tartarus,org            | Northumberland | Army
| + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.

Never drink from your finger bowl; it contains only water.

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 2.6.29-rc4] Restore ACPI reporting via /proc/acpi/events for EeePC & other Asus laptops.
@ 2009-02-10 14:54         ` Darren Salt
  0 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-10 14:54 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Matthew Garrett, Corentin Chary

The descriptions for the following two commits
  2a7dc0d8c60325e9bf820900bf919430e5a419ab (asus-laptop)
  2b25c9f01aa58d48129b2f93748dfb5d1f7ab0a2 (eeepc-laptop)
say that events should ALSO be exported via netlink, but the effect is that
they are INSTEAD exported via netlink. The latter commit breaks use of acpid
on my EeePC 901.

Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>

diff --git a/drivers/platform/x86/asus-laptop.c
b/drivers/platform/x86/asus-laptop.c
index 56af6cf..42ecf6a 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -832,6 +832,8 @@ static void asus_hotk_notify(acpi_handle handle, u32
event, void *data)
 		lcd_blank(FB_BLANK_POWERDOWN);
 	}
 
+	acpi_bus_generate_proc_event(ehotk->device, event,
+				     ehotk->event_count[event % 128]);
 	acpi_bus_generate_netlink_event(hotk->device->pnp.device_class,
 					dev_name(&hotk->device->dev), event,
 					hotk->event_count[event % 128]++);
diff --git a/drivers/platform/x86/eeepc-laptop.c
b/drivers/platform/x86/eeepc-laptop.c
index 786ed86..8511891 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -561,6 +561,8 @@ static void eeepc_hotk_notify(acpi_handle handle, u32
event, void *data)
 		return;
 	if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
 		notify_brn();
+	acpi_bus_generate_proc_event(ehotk->device, event,
+				     ehotk->event_count[event % 128]);
 	acpi_bus_generate_netlink_event(ehotk->device->pnp.device_class,
 					dev_name(&ehotk->device->dev), event,
 					ehotk->event_count[event % 128]++);

-- 
| Darren Salt    | d @ youmustbejoking,demon,co,uk | nr. Ashington, | Toon
| RISC OS, Linux | s   zap,tartarus,org            | Northumberland | Army
| + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.

Never drink from your finger bowl; it contains only water.

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 14:12       ` Darren Salt
@ 2009-02-10 15:04         ` Matthew Garrett
  -1 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-10 15:04 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds

On Tue, Feb 10, 2009 at 02:12:44PM +0000, Darren Salt wrote:

> Reverting this fixes the rfkill oops; things work correctly again. I don't
> know why this appears to be needed, since things work fine without this patch
> ‒ both Fn-F2 and echoing to /sys/class/rfkill/rfkill0/state ‒ even when I
> start up with init=/bin/sh and test directly from that shell.

If this is BIOS version specific I'm going to be upset, but the general 
case behaviour is that rfkill only works on the 901 if you either (a) 
pass force=1 to pciehp (which you shouldn't) or (b) have native support 
in a driver. My /guess/ is that you've got pciehp loaded, and there's 
some kind of awkward race between it and eeepc-laptop.

>   input: ETPS/2 Elantech Touchpad as /class/input/input5
>   eeepc: Hotkey init flags 0x41
> (not seen in .28 or .28.1; not checked later .28.*.)

BIOS bug. There's an explicit delay in the eee bios for some reason, and 
I haven't found any straightforward way to avoid it.

-- 
Matthew Garrett | mjg59@srcf.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-10 15:04         ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-10 15:04 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Darren Salt, Corentin Chary

On Tue, Feb 10, 2009 at 02:12:44PM +0000, Darren Salt wrote:

> Reverting this fixes the rfkill oops; things work correctly again. I don't
> know why this appears to be needed, since things work fine without this patch
> ‒ both Fn-F2 and echoing to /sys/class/rfkill/rfkill0/state ‒ even when I
> start up with init=/bin/sh and test directly from that shell.

If this is BIOS version specific I'm going to be upset, but the general 
case behaviour is that rfkill only works on the 901 if you either (a) 
pass force=1 to pciehp (which you shouldn't) or (b) have native support 
in a driver. My /guess/ is that you've got pciehp loaded, and there's 
some kind of awkward race between it and eeepc-laptop.

>   input: ETPS/2 Elantech Touchpad as /class/input/input5
>   eeepc: Hotkey init flags 0x41
> (not seen in .28 or .28.1; not checked later .28.*.)

BIOS bug. There's an explicit delay in the eee bios for some reason, and 
I haven't found any straightforward way to avoid it.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 15:04         ` Matthew Garrett
@ 2009-02-10 15:15           ` Darren Salt
  -1 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-10 15:15 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary

I demand that Matthew Garrett may or may not have written...

> On Tue, Feb 10, 2009 at 02:12:44PM +0000, Darren Salt wrote:
>> Reverting this fixes the rfkill oops; things work correctly again. I don't
>> know why this appears to be needed, since things work fine without this
>> patch ‒ both Fn-F2 and echoing to /sys/class/rfkill/rfkill0/state ‒ even
>> when I start up with init=/bin/sh and test directly from that shell.

> If this is BIOS version specific I'm going to be upset, but the general
> case behaviour is that rfkill only works on the 901 if you either (a) pass
> force=1 to pciehp (which you shouldn't) or (b) have native support in a
> driver. My /guess/ is that you've got pciehp loaded, and there's some kind
> of awkward race between it and eeepc-laptop.

I have; and yes, pciehp_force=1.

As things stand, this is likely to be a problem for anybody using lenny on
Eee hardware and upgrading (on their own) to 2.6.29, given that that
workaround is present in eeepc-acpi-scripts in lenny.

Anyway, removing that option fixes the problem.

>> [long delay between these two lines]
>>   input: ETPS/2 Elantech Touchpad as /class/input/input5
>>   eeepc: Hotkey init flags 0x41
>> (not seen in .28 or .28.1; not checked later .28.*.)

> BIOS bug. There's an explicit delay in the eee bios for some reason, and 
> I haven't found any straightforward way to avoid it.

BIOS bug or no, the fact remains that this is (AFAICS) a regression.

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.

  10 PRINT "I used to do this in Dixons": POKE 23692,255: GO TO 10
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-10 15:15           ` Darren Salt
  0 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-10 15:15 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary

I demand that Matthew Garrett may or may not have written...

> On Tue, Feb 10, 2009 at 02:12:44PM +0000, Darren Salt wrote:
>> Reverting this fixes the rfkill oops; things work correctly again. I don't
>> know why this appears to be needed, since things work fine without this
>> patch ‒ both Fn-F2 and echoing to /sys/class/rfkill/rfkill0/state ‒ even
>> when I start up with init=/bin/sh and test directly from that shell.

> If this is BIOS version specific I'm going to be upset, but the general
> case behaviour is that rfkill only works on the 901 if you either (a) pass
> force=1 to pciehp (which you shouldn't) or (b) have native support in a
> driver. My /guess/ is that you've got pciehp loaded, and there's some kind
> of awkward race between it and eeepc-laptop.

I have; and yes, pciehp_force=1.

As things stand, this is likely to be a problem for anybody using lenny on
Eee hardware and upgrading (on their own) to 2.6.29, given that that
workaround is present in eeepc-acpi-scripts in lenny.

Anyway, removing that option fixes the problem.

>> [long delay between these two lines]
>>   input: ETPS/2 Elantech Touchpad as /class/input/input5
>>   eeepc: Hotkey init flags 0x41
>> (not seen in .28 or .28.1; not checked later .28.*.)

> BIOS bug. There's an explicit delay in the eee bios for some reason, and 
> I haven't found any straightforward way to avoid it.

BIOS bug or no, the fact remains that this is (AFAICS) a regression.

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.

  10 PRINT "I used to do this in Dixons": POKE 23692,255: GO TO 10

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 15:15           ` Darren Salt
@ 2009-02-10 15:45             ` Matthew Garrett
  -1 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-10 15:45 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds

On Tue, Feb 10, 2009 at 03:15:21PM +0000, Darren Salt wrote:

> As things stand, this is likely to be a problem for anybody using lenny on
> Eee hardware and upgrading (on their own) to 2.6.29, given that that
> workaround is present in eeepc-acpi-scripts in lenny.
> 
> Anyway, removing that option fixes the problem.

Ok. I'll look into ensuring that these don't collide, but fundamentally 
the problem here is distributions using broken options rather than 
fixing the problem properly in the first place.

> > BIOS bug. There's an explicit delay in the eee bios for some reason, and 
> > I haven't found any straightforward way to avoid it.
> 
> BIOS bug or no, the fact remains that this is (AFAICS) a regression.

You don't get properly working hotkeys otherwise, to the best of my 
recollection. There's an entry on the kernel bugzilla about this 
somewhere.
-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-10 15:45             ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-10 15:45 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary, Darren Salt

On Tue, Feb 10, 2009 at 03:15:21PM +0000, Darren Salt wrote:

> As things stand, this is likely to be a problem for anybody using lenny on
> Eee hardware and upgrading (on their own) to 2.6.29, given that that
> workaround is present in eeepc-acpi-scripts in lenny.
> 
> Anyway, removing that option fixes the problem.

Ok. I'll look into ensuring that these don't collide, but fundamentally 
the problem here is distributions using broken options rather than 
fixing the problem properly in the first place.

> > BIOS bug. There's an explicit delay in the eee bios for some reason, and 
> > I haven't found any straightforward way to avoid it.
> 
> BIOS bug or no, the fact remains that this is (AFAICS) a regression.

You don't get properly working hotkeys otherwise, to the best of my 
recollection. There's an entry on the kernel bugzilla about this 
somewhere.
-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 15:45             ` Matthew Garrett
  (?)
@ 2009-02-10 16:03             ` Darren Salt
  2009-02-23 16:39                 ` Matthew Garrett
  -1 siblings, 1 reply; 50+ messages in thread
From: Darren Salt @ 2009-02-10 16:03 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary

I demand that Matthew Garrett may or may not have written...

> On Tue, Feb 10, 2009 at 03:15:21PM +0000, Darren Salt wrote:
>> As things stand, this is likely to be a problem for anybody using lenny on
>> Eee hardware and upgrading (on their own) to 2.6.29, given that that
>> workaround is present in eeepc-acpi-scripts in lenny.
>> Anyway, removing that option fixes the problem.

> Ok. I'll look into ensuring that these don't collide, but fundamentally the
> problem here is distributions using broken options rather than fixing the
> problem properly in the first place.

Not so much "broken options" as "using the ony available workaround at the
time", I think. I have no idea what action other than using this option was
taken.

>>> BIOS bug. There's an explicit delay in the eee bios for some reason,
>>> and I haven't found any straightforward way to avoid it.
>> BIOS bug or no, the fact remains that this is (AFAICS) a regression.

> You don't get properly working hotkeys otherwise, to the best of my
> recollection.

I can't say that I've noticed any problems.

> There's an entry on the kernel bugzilla about this somewhere.

This one, I think: http://bugzilla.kernel.org/show_bug.cgi?id=12243

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
|   Kill all extremists!

"The name's Borg, James Borg. Prepare to be assimilated, Miss Moneypenny."

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 15:45             ` Matthew Garrett
  (?)
  (?)
@ 2009-02-10 16:06             ` Corentin Chary
  2009-02-10 19:16               ` Darren Salt
  2009-02-11  1:23               ` yakui_zhao
  -1 siblings, 2 replies; 50+ messages in thread
From: Corentin Chary @ 2009-02-10 16:06 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Darren Salt

On Tue, Feb 10, 2009 at 4:45 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, Feb 10, 2009 at 03:15:21PM +0000, Darren Salt wrote:
>
>> As things stand, this is likely to be a problem for anybody using lenny on
>> Eee hardware and upgrading (on their own) to 2.6.29, given that that
>> workaround is present in eeepc-acpi-scripts in lenny.
>>
>> Anyway, removing that option fixes the problem.
>
> Ok. I'll look into ensuring that these don't collide, but fundamentally
> the problem here is distributions using broken options rather than
> fixing the problem properly in the first place.
>
>> > BIOS bug. There's an explicit delay in the eee bios for some reason, and
>> > I haven't found any straightforward way to avoid it.
>>
>> BIOS bug or no, the fact remains that this is (AFAICS) a regression.
>
> You don't get properly working hotkeys otherwise, to the best of my
> recollection. There's an entry on the kernel bugzilla about this
> somewhere.
> --
> Matthew Garrett | mjg59@srcf.ucam.org

http://bugzilla.kernel.org/show_bug.cgi?id=12243
If I understand things correctly, this was already the case before,
but the kernel boot was slower, so we could'nt see that.
If it's not the case, someone with a 901 should try bisecting (I only
have a 701).


-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 16:06             ` Corentin Chary
@ 2009-02-10 19:16               ` Darren Salt
  2009-02-11  2:03                   ` Matthew Garrett
  2009-02-11  1:23               ` yakui_zhao
  1 sibling, 1 reply; 50+ messages in thread
From: Darren Salt @ 2009-02-10 19:16 UTC (permalink / raw)
  To: Corentin Chary
  Cc: Matthew Garrett, Ingo Molnar, linux-kernel, linux-acpi,
	Rafael J. Wysocki, Len Brown, Linus Torvalds, Andrew Morton,
	Jesse Barnes, Thomas Gleixner, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 2834 bytes --]

I demand that Corentin Chary may or may not have written...

> On Tue, Feb 10, 2009 at 4:45 PM, Matthew Garrett <mjg59@srcf.ucam.org>
> wrote:
[snip; long delay when initialising eeepc-laptop]
>>>> BIOS bug. There's an explicit delay in the eee bios for some reason, and
>>>> I haven't found any straightforward way to avoid it.
>>> BIOS bug or no, the fact remains that this is (AFAICS) a regression.
>> You don't get properly working hotkeys otherwise, to the best of my
>> recollection. There's an entry on the kernel bugzilla about this
>> somewhere.

> http://bugzilla.kernel.org/show_bug.cgi?id=12243
> If I understand things correctly, this was already the case before, but the
> kernel boot was slower, so we couldn't see that. If it's not the case,
> someone with a 901 should try bisecting (I only have a 701).

I have some timings...

>From 2.6.28.4:
[    0.898903] eeepc: Eee PC Hotkey Driver
[    0.902414] eeepc: Hotkey init (getting ACPI bus status)
[    0.905913] eeepc: Hotkey init (init flags)
[    2.620193] eeepc: Hotkey init flags 0x41
[    2.626667] eeepc: Get control methods supported: 0x101713
[    2.630215] input: Asus EeePC extra buttons as /class/input/input4

>From 2.6.29-rc4:

[    2.141971] eeepc: Eee PC Hotkey Driver
[    2.145325] eeepc: Hotkey init (getting ACPI bus status)
[    2.148555] eeepc: Hotkey init (init flags)
[    2.286445] usb 5-1: new full speed USB device using uhci_hcd and address 2
[... USB Bluetooth device; Elantech test ...]
[    2.780187] input: ETPS/2 Elantech Touchpad as /class/input/input5
[   28.088399] eeepc: Hotkey init flags 0x41
[   28.094880] eeepc: Get control methods supported: 0x101713
[   28.098425] input: Asus EeePC extra buttons as /class/input/input6

Config is as in my first posting in this thread; kernel logs are attached.
The following patch is applied:

--- ./drivers/platform/x86/eeepc-laptop.c~	2009-02-10 16:40:18.000000000 +0000
+++ ./drivers/platform/x86/eeepc-laptop.c	2009-02-10 16:40:18.000000000 +0000
@@ -452,10 +452,15 @@
 	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 	int result;
 
+	printk(EEEPC_NOTICE "Hotkey init (getting ACPI bus status)\n");
 	result = acpi_bus_get_status(ehotk->device);
 	if (result)
+	{
+		printk(EEEPC_ERR "Hotkey init aborted (%d)\n", result);
 		return result;
+	}
 	if (ehotk->device->status.present) {
+		printk(EEEPC_NOTICE "Hotkey init (init flags)\n");
 		if (write_acpi_int(ehotk->handle, "INIT", ehotk->init_flag,
 				    &buffer)) {
 			printk(EEEPC_ERR "Hotkey initialization failed\n");

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Buy less and make it last longer.         INDUSTRY CAUSES GLOBAL WARMING.

If at first you don't succeed, give up. No use being a damn fool.

[-- Attachment #2: dmesg-28.4.txt.gz --]
[-- Type: application/x-gzip, Size: 10424 bytes --]

[-- Attachment #3: dmesg-29-rc4.txt.gz --]
[-- Type: application/x-gzip, Size: 10777 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-10 14:02 ` [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4) Mel Gorman
@ 2009-02-10 23:45   ` Andrew Morton
  2009-02-11 11:15     ` Mel Gorman
  2009-02-11  9:43   ` Andy Whitcroft
  1 sibling, 1 reply; 50+ messages in thread
From: Andrew Morton @ 2009-02-10 23:45 UTC (permalink / raw)
  To: Mel Gorman
  Cc: torvalds, linux-kernel, kosaki.motohiro, hugh, Lee.Schermerhorn,
	gregkh, maksim.yevmenkin, npiggin, will, riel, kamezawa.hiroyu,
	miklos, apw, wli

On Tue, 10 Feb 2009 14:02:27 +0000
Mel Gorman <mel@csn.ul.ie> wrote:

> On Sun, Feb 08, 2009 at 01:01:04PM -0800, Linus Torvalds wrote:
> > 
> > Another week (and a half), another -rc.
> > 
> > Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> > updates, FS updates (ubifs, btrfs), you name it. It's all there.
> > 
> > But more importantly, people really have been working on regressions, and 
> > hopefully this closes a nice set of the top one, and hopefully without 
> > introducing too many new ones.
> > 
> 
> Hugepages are currently busted due to commit
> fc8744adc870a8d4366908221508bb113d8b72ee and the problem is in
> 2.6.29-rc4. There was a bit of a discussion but it didn't get very far and
> then I went offline for the weekend. Here is a revised patch that tries to
> bring hugetlbfs more in line with what the core VM is doing by dealing with
> VM_ACCOUNT and VM_NORESERVE.
> 
> =============
> Do not account for the address space used by hugetlbfs using VM_ACCOUNT
> 
> When overcommit is disabled, the core VM accounts for pages used by anonymous
> shared, private mappings and special mappings. It keeps track of VMAs that
> should be accounted for with VM_ACCOUNT and VMAs that never had a reserve
> with VM_NORESERVE.
> 
> Overcommit for hugetlbfs is much riskier than overcommit for base pages
> due to contiguity requirements. It avoids overcommiting on both shared and
> private mappings using reservation counters that are checked and updated
> during mmap(). This ensures (within limits) that hugepages exist in the
> future when faults occurs or it is too easy to applications to be SIGKILLed.
> 
> As hugetlbfs makes its own reservations of a different unit to the base page
> size, VM_ACCOUNT should never be set. Even if the units were correct, we would
> double account for the usage in the core VM and hugetlbfs. VM_NORESERVE may
> be set because an application can request no reserves be made for hugetlbfs
> at the risk of getting killed later.
> 
> With commit fc8744adc870a8d4366908221508bb113d8b72ee, VM_NORESERVE and
> VM_ACCOUNT are getting unconditionally set for hugetlbfs-backed mappings. This
> breaks the accounting for both the core VM and hugetlbfs, can trigger an
> OOM storm when hugepage pools are too small lockups and corrupted counters
> otherwise are used. This patch brings hugetlbfs more in line with how the
> core VM treats VM_NORESERVE but prevents VM_ACCOUNT being set.
> 
> ...
>
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -108,7 +108,8 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
>  
>  	if (hugetlb_reserve_pages(inode,
>  				vma->vm_pgoff >> huge_page_order(h),
> -				len >> huge_page_shift(h), vma))
> +				len >> huge_page_shift(h), vma,
> +				vma->vm_flags))
>  		goto out;
>  
>  	ret = 0;
> @@ -947,7 +948,7 @@ static int can_do_hugetlb_shm(void)
>  			can_do_mlock());
>  }
>  
> -struct file *hugetlb_file_setup(const char *name, size_t size)
> +struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)

This superundocumented acctflag looks like a poorly-named boolean.  But
it is fact a composition of VM_foo bits.

Would it not be clearer to name it `vm_flags'?

>  {
>  	int error = -ENOMEM;
>  	struct file *file;
> @@ -981,7 +982,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size)
>  
>  	error = -ENOMEM;
>  	if (hugetlb_reserve_pages(inode, 0,
> -			size >> huge_page_shift(hstate_inode(inode)), NULL))
> +			size >> huge_page_shift(hstate_inode(inode)), NULL,
> +			acctflag))
>  		goto out_inode;
>  
>  	d_instantiate(dentry, inode);
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index f1d2fba..af09660 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -33,7 +33,8 @@ unsigned long hugetlb_total_pages(void);
>  int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
>  			unsigned long address, int write_access);
>  int hugetlb_reserve_pages(struct inode *inode, long from, long to,
> -						struct vm_area_struct *vma);
> +						struct vm_area_struct *vma,
> +						int acctflags);

here it went plural.

>  void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
>  
>  extern unsigned long hugepages_treat_as_movable;
> @@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
>  
>  extern const struct file_operations hugetlbfs_file_operations;
>  extern struct vm_operations_struct hugetlb_vm_ops;
> -struct file *hugetlb_file_setup(const char *name, size_t);
> +struct file *hugetlb_file_setup(const char *name, size_t, int);

Here it is omitted altogether.  We now have one named parameter and two
secret ones.


Also, the patch forgot to update this:

#define hugetlb_file_setup(name,size)   ERR_PTR(-ENOSYS)

Which I assume breaks CONFIG_HUGETLBFS=n.

> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index e8ddc98..3235615 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1129,8 +1129,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
>  	unsigned long flag, unsigned long pgoff);
>  extern unsigned long mmap_region(struct file *file, unsigned long addr,
>  	unsigned long len, unsigned long flags,
> -	unsigned int vm_flags, unsigned long pgoff,
> -	int accountable);
> +	unsigned int vm_flags, unsigned long pgoff);

And there is a vm_flags which has type `unsigned int'.

Your newly-added should-have-been-called-vm_flags has type `int'.

The vm_flagses in `struct vm_region' and `struct vm_area_struct' have type
`unsigned long'.

It'd be nice to get these consistent.  We only have two bits left in
the vm_flags namespace so arguably we could add a vm_flags_t while
fixing this up, with a view to makeing it u64 later.  Maybe.



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 16:06             ` Corentin Chary
  2009-02-10 19:16               ` Darren Salt
@ 2009-02-11  1:23               ` yakui_zhao
  1 sibling, 0 replies; 50+ messages in thread
From: yakui_zhao @ 2009-02-11  1:23 UTC (permalink / raw)
  To: Corentin Chary
  Cc: Matthew Garrett, Ingo Molnar, linux-kernel, linux-acpi,
	Rafael J. Wysocki, Len Brown, Linus Torvalds, Andrew Morton,
	Jesse Barnes, Thomas Gleixner, H. Peter Anvin, Darren Salt

On Wed, 2009-02-11 at 00:06 +0800, Corentin Chary wrote:
> On Tue, Feb 10, 2009 at 4:45 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> > On Tue, Feb 10, 2009 at 03:15:21PM +0000, Darren Salt wrote:
> >
> >> As things stand, this is likely to be a problem for anybody using lenny on
> >> Eee hardware and upgrading (on their own) to 2.6.29, given that that
> >> workaround is present in eeepc-acpi-scripts in lenny.
> >>
> >> Anyway, removing that option fixes the problem.
> >
> > Ok. I'll look into ensuring that these don't collide, but fundamentally
> > the problem here is distributions using broken options rather than
> > fixing the problem properly in the first place.
> >
> >> > BIOS bug. There's an explicit delay in the eee bios for some reason, and
> >> > I haven't found any straightforward way to avoid it.
> >>
> >> BIOS bug or no, the fact remains that this is (AFAICS) a regression.
> >
> > You don't get properly working hotkeys otherwise, to the best of my
> > recollection. There's an entry on the kernel bugzilla about this
> > somewhere.
> > --
> > Matthew Garrett | mjg59@srcf.ucam.org
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=12243
> If I understand things correctly, this was already the case before,
> but the kernel boot was slower, so we could'nt see that.
> If it's not the case, someone with a 901 should try bisecting (I only
> have a 701).
I have an Asus EEEPC901. And it will take about 1 second to execute the
ACPI INIT object, which is defined in BIOS.
    From the ACPI AML code it seems that there exist some explicit
delays. But we have nothing to avoid it.  
> 
> 


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 19:16               ` Darren Salt
@ 2009-02-11  2:03                   ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-11  2:03 UTC (permalink / raw)
  To: Corentin Chary, Ingo Molnar, linux-kernel, linux-acpi,
	Rafael J. Wysocki, Len Brown

On Tue, Feb 10, 2009 at 07:16:27PM +0000, Darren Salt wrote:

> From 2.6.28.4:
> [    0.898903] eeepc: Eee PC Hotkey Driver
> [    0.902414] eeepc: Hotkey init (getting ACPI bus status)
> [    0.905913] eeepc: Hotkey init (init flags)
> [    2.620193] eeepc: Hotkey init flags 0x41
> [    2.626667] eeepc: Get control methods supported: 0x101713
> [    2.630215] input: Asus EeePC extra buttons as /class/input/input4

So we see the expected BIOS bizarro pause there...

> From 2.6.29-rc4:
> 
> [    2.141971] eeepc: Eee PC Hotkey Driver
> [    2.145325] eeepc: Hotkey init (getting ACPI bus status)
> [    2.148555] eeepc: Hotkey init (init flags)
> [    2.286445] usb 5-1: new full speed USB device using uhci_hcd and address 2
> [... USB Bluetooth device; Elantech test ...]
> [    2.780187] input: ETPS/2 Elantech Touchpad as /class/input/input5
> [   28.088399] eeepc: Hotkey init flags 0x41
> [   28.094880] eeepc: Get control methods supported: 0x101713
> [   28.098425] input: Asus EeePC extra buttons as /class/input/input6

And a rather more upsetting 26 second pause here. Yeah, ok, that's 
clearly a regression. I don't see any obvious way that it's an 
eeepc-laptop bug, though...

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-11  2:03                   ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-11  2:03 UTC (permalink / raw)
  To: Corentin Chary, Ingo Molnar, linux-kernel, linux-acpi,
	Rafael J. Wysocki, Len Brown, Linus Torvalds, Andrew Morton,
	Jesse Barnes, Thomas Gleixner, H. Peter Anvin, Darren Salt

On Tue, Feb 10, 2009 at 07:16:27PM +0000, Darren Salt wrote:

> From 2.6.28.4:
> [    0.898903] eeepc: Eee PC Hotkey Driver
> [    0.902414] eeepc: Hotkey init (getting ACPI bus status)
> [    0.905913] eeepc: Hotkey init (init flags)
> [    2.620193] eeepc: Hotkey init flags 0x41
> [    2.626667] eeepc: Get control methods supported: 0x101713
> [    2.630215] input: Asus EeePC extra buttons as /class/input/input4

So we see the expected BIOS bizarro pause there...

> From 2.6.29-rc4:
> 
> [    2.141971] eeepc: Eee PC Hotkey Driver
> [    2.145325] eeepc: Hotkey init (getting ACPI bus status)
> [    2.148555] eeepc: Hotkey init (init flags)
> [    2.286445] usb 5-1: new full speed USB device using uhci_hcd and address 2
> [... USB Bluetooth device; Elantech test ...]
> [    2.780187] input: ETPS/2 Elantech Touchpad as /class/input/input5
> [   28.088399] eeepc: Hotkey init flags 0x41
> [   28.094880] eeepc: Get control methods supported: 0x101713
> [   28.098425] input: Asus EeePC extra buttons as /class/input/input6

And a rather more upsetting 26 second pause here. Yeah, ok, that's 
clearly a regression. I don't see any obvious way that it's an 
eeepc-laptop bug, though...

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-10 14:02 ` [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4) Mel Gorman
  2009-02-10 23:45   ` Andrew Morton
@ 2009-02-11  9:43   ` Andy Whitcroft
  2009-02-11 10:30     ` Mel Gorman
  1 sibling, 1 reply; 50+ messages in thread
From: Andy Whitcroft @ 2009-02-11  9:43 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

On Tue, Feb 10, 2009 at 02:02:27PM +0000, Mel Gorman wrote:
> On Sun, Feb 08, 2009 at 01:01:04PM -0800, Linus Torvalds wrote:
> > 
> > Another week (and a half), another -rc.
> > 
> > Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> > updates, FS updates (ubifs, btrfs), you name it. It's all there.
> > 
> > But more importantly, people really have been working on regressions, and 
> > hopefully this closes a nice set of the top one, and hopefully without 
> > introducing too many new ones.
> > 
> 
> Hugepages are currently busted due to commit
> fc8744adc870a8d4366908221508bb113d8b72ee and the problem is in
> 2.6.29-rc4. There was a bit of a discussion but it didn't get very far and
> then I went offline for the weekend. Here is a revised patch that tries to
> bring hugetlbfs more in line with what the core VM is doing by dealing with
> VM_ACCOUNT and VM_NORESERVE.
> 
> =============
> Do not account for the address space used by hugetlbfs using VM_ACCOUNT
> 
> When overcommit is disabled, the core VM accounts for pages used by anonymous
> shared, private mappings and special mappings. It keeps track of VMAs that
> should be accounted for with VM_ACCOUNT and VMAs that never had a reserve
> with VM_NORESERVE.
> 
> Overcommit for hugetlbfs is much riskier than overcommit for base pages
> due to contiguity requirements. It avoids overcommiting on both shared and
> private mappings using reservation counters that are checked and updated
> during mmap(). This ensures (within limits) that hugepages exist in the
> future when faults occurs or it is too easy to applications to be SIGKILLed.
> 
> As hugetlbfs makes its own reservations of a different unit to the base page
> size, VM_ACCOUNT should never be set. Even if the units were correct, we would
> double account for the usage in the core VM and hugetlbfs. VM_NORESERVE may
> be set because an application can request no reserves be made for hugetlbfs
> at the risk of getting killed later.
> 
> With commit fc8744adc870a8d4366908221508bb113d8b72ee, VM_NORESERVE and
> VM_ACCOUNT are getting unconditionally set for hugetlbfs-backed mappings. This
> breaks the accounting for both the core VM and hugetlbfs, can trigger an
> OOM storm when hugepage pools are too small lockups and corrupted counters
> otherwise are used. This patch brings hugetlbfs more in line with how the
> core VM treats VM_NORESERVE but prevents VM_ACCOUNT being set.
> 
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> --- 
>  fs/hugetlbfs/inode.c    |    8 +++++---
>  include/linux/hugetlb.h |    5 +++--
>  include/linux/mm.h      |    3 +--
>  ipc/shm.c               |    8 +++++---
>  mm/fremap.c             |    2 +-
>  mm/hugetlb.c            |   39 +++++++++++++++++++++++++--------------
>  mm/mmap.c               |   38 ++++++++++++++++++++++----------------
>  mm/mprotect.c           |    5 +++--
>  8 files changed, 65 insertions(+), 43 deletions(-)
> 
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index 6903d37..9b800d9 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -108,7 +108,8 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
>  
>  	if (hugetlb_reserve_pages(inode,
>  				vma->vm_pgoff >> huge_page_order(h),
> -				len >> huge_page_shift(h), vma))
> +				len >> huge_page_shift(h), vma,
> +				vma->vm_flags))
>  		goto out;
>  
>  	ret = 0;
> @@ -947,7 +948,7 @@ static int can_do_hugetlb_shm(void)
>  			can_do_mlock());
>  }
>  
> -struct file *hugetlb_file_setup(const char *name, size_t size)
> +struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
>  {
>  	int error = -ENOMEM;
>  	struct file *file;
> @@ -981,7 +982,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size)
>  
>  	error = -ENOMEM;
>  	if (hugetlb_reserve_pages(inode, 0,
> -			size >> huge_page_shift(hstate_inode(inode)), NULL))
> +			size >> huge_page_shift(hstate_inode(inode)), NULL,
> +			acctflag))
>  		goto out_inode;
>  
>  	d_instantiate(dentry, inode);
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index f1d2fba..af09660 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -33,7 +33,8 @@ unsigned long hugetlb_total_pages(void);
>  int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
>  			unsigned long address, int write_access);
>  int hugetlb_reserve_pages(struct inode *inode, long from, long to,
> -						struct vm_area_struct *vma);
> +						struct vm_area_struct *vma,
> +						int acctflags);
>  void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
>  
>  extern unsigned long hugepages_treat_as_movable;
> @@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
>  
>  extern const struct file_operations hugetlbfs_file_operations;
>  extern struct vm_operations_struct hugetlb_vm_ops;
> -struct file *hugetlb_file_setup(const char *name, size_t);
> +struct file *hugetlb_file_setup(const char *name, size_t, int);
>  int hugetlb_get_quota(struct address_space *mapping, long delta);
>  void hugetlb_put_quota(struct address_space *mapping, long delta);
>  
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index e8ddc98..3235615 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1129,8 +1129,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
>  	unsigned long flag, unsigned long pgoff);
>  extern unsigned long mmap_region(struct file *file, unsigned long addr,
>  	unsigned long len, unsigned long flags,
> -	unsigned int vm_flags, unsigned long pgoff,
> -	int accountable);
> +	unsigned int vm_flags, unsigned long pgoff);
>  
>  static inline unsigned long do_mmap(struct file *file, unsigned long addr,
>  	unsigned long len, unsigned long prot,
> diff --git a/ipc/shm.c b/ipc/shm.c
> index f8f69fa..05d51d2 100644
> --- a/ipc/shm.c
> +++ b/ipc/shm.c
> @@ -340,6 +340,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
>  	struct file * file;
>  	char name[13];
>  	int id;
> +	int acctflag = 0;
>  
>  	if (size < SHMMIN || size > ns->shm_ctlmax)
>  		return -EINVAL;
> @@ -364,11 +365,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
>  
>  	sprintf (name, "SYSV%08x", key);
>  	if (shmflg & SHM_HUGETLB) {
> -		/* hugetlb_file_setup takes care of mlock user accounting */
> -		file = hugetlb_file_setup(name, size);
> +		/* hugetlb_file_setup applies strict accounting */
> +		if (shmflg & SHM_NORESERVE)
> +			acctflag = VM_NORESERVE;
> +		file = hugetlb_file_setup(name, size, acctflag);

Does this change semantics?  At first look it appears that you are now
implementing SHM_NORESERVE for SHM_HUGETLB where we did not previously
do so?  Not that this is necesarily a bad thing, just feels like its
changing.

>  		shp->mlock_user = current_user();
>  	} else {
> -		int acctflag = 0;
>  		/*
>  		 * Do not allow no accounting for OVERCOMMIT_NEVER, even
>  	 	 * if it's asked for.
> diff --git a/mm/fremap.c b/mm/fremap.c
> index 736ba7f..b6ec85a 100644
> --- a/mm/fremap.c
> +++ b/mm/fremap.c
> @@ -198,7 +198,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
>  			flags &= MAP_NONBLOCK;
>  			get_file(file);
>  			addr = mmap_region(file, start, size,
> -					flags, vma->vm_flags, pgoff, 1);
> +					flags, vma->vm_flags, pgoff);
>  			fput(file);
>  			if (IS_ERR_VALUE(addr)) {
>  				err = addr;
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 618e983..2074642 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2269,14 +2269,12 @@ void hugetlb_change_protection(struct vm_area_struct *vma,
>  
>  int hugetlb_reserve_pages(struct inode *inode,
>  					long from, long to,
> -					struct vm_area_struct *vma)
> +					struct vm_area_struct *vma,
> +					int acctflag)
>  {
> -	long ret, chg;
> +	long ret = 0, chg;
>  	struct hstate *h = hstate_inode(inode);
>  
> -	if (vma && vma->vm_flags & VM_NORESERVE)
> -		return 0;
> -
>  	/*
>  	 * Shared mappings base their reservation on the number of pages that
>  	 * are already allocated on behalf of the file. Private mappings need
> @@ -2285,22 +2283,25 @@ int hugetlb_reserve_pages(struct inode *inode,
>  	 */
>  	if (!vma || vma->vm_flags & VM_SHARED)
>  		chg = region_chg(&inode->i_mapping->private_list, from, to);

I thought the region map for a VM_SHARED mapping is meant to contain
those pages for which we already have a reservation allocated.  So that
if we have overlapping VM_RESERVE and VM_NORESERVE mappings we know that
we did have a page reserved at fault time and know whether we can take
it from the reserve portion of the pool.  By letting this get executed
for VM_NORESERVE mappings that would seem to be getting out of sync,
which doesn't sound right.  I don't see any updates to the documentation
on the meanings of reservation map if you are changing it?

Here is the commentry from mm/hugetlb.c:

 * The private mapping reservation is represented in a subtly different
 * manner to a shared mapping.  A shared mapping has a region map associated
 * with the underlying file, this region map represents the backing file
 * pages which have ever had a reservation assigned which this persists even
 * after the page is instantiated.  A private mapping has a region map
 * associated with the original mmap which is attached to all VMAs which
 * reference it, this region map represents those offsets which have consumed
 * reservation ie. where pages have been instantiated.

> -	else {
> -		struct resv_map *resv_map = resv_map_alloc();
> -		if (!resv_map)
> -			return -ENOMEM;
> -
> +	else
>  		chg = to - from;
>  
> -		set_vma_resv_map(vma, resv_map);
> -		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
> -	}
> -
>  	if (chg < 0)
>  		return chg;
>  
>  	if (hugetlb_get_quota(inode->i_mapping, chg))
>  		return -ENOSPC;
> +
> +	/*
> +	 * Only apply hugepage reservation if asked. We still have to
> +	 * take the filesystem quota because it is an upper limit
> +	 * defined for the mount and not necessarily memory as a whole
> +	 */
> +	if (acctflag & VM_NORESERVE) {
> +		reset_vma_resv_huge_pages(vma);

Why do we now need to do this in the non-reserve case?  We didn't need
to do it before.

> +		return 0;
> +	}
> +

This also seems like a semantic change.  Previously NO_RESERVE did not
take quota, now it does.  NO_RESERVE used to mean that we took our
chances on there being pages available at fault time both for quota and
in the pools.  Now it means that we only risk there being no pages.
Does that not significantly change semantics.  The main use case for
NO_RESERVE was mapping a massive area to expand into, this might now be
refused for quota when previously it was not.

>  	ret = hugetlb_acct_memory(h, chg);
>  	if (ret < 0) {
>  		hugetlb_put_quota(inode->i_mapping, chg);
> @@ -2308,6 +2309,16 @@ int hugetlb_reserve_pages(struct inode *inode,
>  	}
>  	if (!vma || vma->vm_flags & VM_SHARED)
>  		region_add(&inode->i_mapping->private_list, from, to);
> +	else {
> +		struct resv_map *resv_map = resv_map_alloc();
> +
> +		if (!resv_map)
> +			return -ENOMEM;
> +
> +		set_vma_resv_map(vma, resv_map);
> +		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
> +	}
> +
>  	return 0;
>  }
>  
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 214b6a2..6f70db8 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -918,7 +918,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
>  	struct inode *inode;
>  	unsigned int vm_flags;
>  	int error;
> -	int accountable = 1;
>  	unsigned long reqprot = prot;
>  
>  	/*
> @@ -1019,8 +1018,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
>  					return -EPERM;
>  				vm_flags &= ~VM_MAYEXEC;
>  			}
> -			if (is_file_hugepages(file))
> -				accountable = 0;
>  
>  			if (!file->f_op || !file->f_op->mmap)
>  				return -ENODEV;
> @@ -1053,8 +1050,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
>  	if (error)
>  		return error;
>  
> -	return mmap_region(file, addr, len, flags, vm_flags, pgoff,
> -			   accountable);
> +	return mmap_region(file, addr, len, flags, vm_flags, pgoff);
>  }
>  EXPORT_SYMBOL(do_mmap_pgoff);
>  
> @@ -1092,17 +1088,23 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
>  
>  /*
>   * We account for memory if it's a private writeable mapping,
> - * and VM_NORESERVE wasn't set.
> + * not hugepages and VM_NORESERVE wasn't set.
>   */
> -static inline int accountable_mapping(unsigned int vm_flags)
> +static inline int accountable_mapping(struct file *file, unsigned int vm_flags)
>  {
> +	/*
> +	 * hugetlb has its own accounting separate from the core VM
> +	 * VM_HUGETLB may not be set yet so we cannot check for that flag.
> +	 */
> +	if (file && is_file_hugepages(file))
> +		return 0;
> +
>  	return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE;
>  }
>  
>  unsigned long mmap_region(struct file *file, unsigned long addr,
>  			  unsigned long len, unsigned long flags,
> -			  unsigned int vm_flags, unsigned long pgoff,
> -			  int accountable)
> +			  unsigned int vm_flags, unsigned long pgoff)
>  {
>  	struct mm_struct *mm = current->mm;
>  	struct vm_area_struct *vma, *prev;
> @@ -1128,18 +1130,22 @@ munmap_back:
>  
>  	/*
>  	 * Set 'VM_NORESERVE' if we should not account for the
> -	 * memory use of this mapping. We only honor MAP_NORESERVE
> -	 * if we're allowed to overcommit memory.
> +	 * memory use of this mapping.
>  	 */
> -	if ((flags & MAP_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER)
> -		vm_flags |= VM_NORESERVE;
> -	if (!accountable)
> -		vm_flags |= VM_NORESERVE;
> +	if ((flags & MAP_NORESERVE)) {
> +	 	/* * We honor MAP_NORESERVE if allowed to overcommit */
> +		if (sysctl_overcommit_memory != OVERCOMMIT_NEVER)
> +			vm_flags |= VM_NORESERVE;
> +
> +		/* hugetlb applies strict overcommit unless MAP_NORESERVE */
> +		if (file && is_file_hugepages(file))
> +			vm_flags |= VM_NORESERVE;
> +	}
>  
>  	/*
>  	 * Private writable mapping: check memory availability
>  	 */
> -	if (accountable_mapping(vm_flags)) {
> +	if (accountable_mapping(file, vm_flags)) {
>  		charged = len >> PAGE_SHIFT;
>  		if (security_vm_enough_memory(charged))
>  			return -ENOMEM;
> diff --git a/mm/mprotect.c b/mm/mprotect.c
> index abe2694..258197b 100644
> --- a/mm/mprotect.c
> +++ b/mm/mprotect.c
> @@ -151,10 +151,11 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
>  	/*
>  	 * If we make a private mapping writable we increase our commit;
>  	 * but (without finer accounting) cannot reduce our commit if we
> -	 * make it unwritable again.
> +	 * make it unwritable again. hugetlb mapping were accounted for
> +	 * even if read-only so there is no need to account for them here
>  	 */
>  	if (newflags & VM_WRITE) {
> -		if (!(oldflags & (VM_ACCOUNT|VM_WRITE|
> +		if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_HUGETLB|
>  						VM_SHARED|VM_NORESERVE))) {
>  			charged = nrpages;
>  			if (security_vm_enough_memory(charged))
> 

-apw

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-11  9:43   ` Andy Whitcroft
@ 2009-02-11 10:30     ` Mel Gorman
  2009-02-11 12:03       ` Andy Whitcroft
  0 siblings, 1 reply; 50+ messages in thread
From: Mel Gorman @ 2009-02-11 10:30 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

On Wed, Feb 11, 2009 at 09:43:29AM +0000, Andy Whitcroft wrote:
> On Tue, Feb 10, 2009 at 02:02:27PM +0000, Mel Gorman wrote:
> > On Sun, Feb 08, 2009 at 01:01:04PM -0800, Linus Torvalds wrote:
> > > 
> > > Another week (and a half), another -rc.
> > > 
> > > Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> > > updates, FS updates (ubifs, btrfs), you name it. It's all there.
> > > 
> > > But more importantly, people really have been working on regressions, and 
> > > hopefully this closes a nice set of the top one, and hopefully without 
> > > introducing too many new ones.
> > > 
> > 
> > Hugepages are currently busted due to commit
> > fc8744adc870a8d4366908221508bb113d8b72ee and the problem is in
> > 2.6.29-rc4. There was a bit of a discussion but it didn't get very far and
> > then I went offline for the weekend. Here is a revised patch that tries to
> > bring hugetlbfs more in line with what the core VM is doing by dealing with
> > VM_ACCOUNT and VM_NORESERVE.
> > 
> > =============
> > Do not account for the address space used by hugetlbfs using VM_ACCOUNT
> > 
> > When overcommit is disabled, the core VM accounts for pages used by anonymous
> > shared, private mappings and special mappings. It keeps track of VMAs that
> > should be accounted for with VM_ACCOUNT and VMAs that never had a reserve
> > with VM_NORESERVE.
> > 
> > Overcommit for hugetlbfs is much riskier than overcommit for base pages
> > due to contiguity requirements. It avoids overcommiting on both shared and
> > private mappings using reservation counters that are checked and updated
> > during mmap(). This ensures (within limits) that hugepages exist in the
> > future when faults occurs or it is too easy to applications to be SIGKILLed.
> > 
> > As hugetlbfs makes its own reservations of a different unit to the base page
> > size, VM_ACCOUNT should never be set. Even if the units were correct, we would
> > double account for the usage in the core VM and hugetlbfs. VM_NORESERVE may
> > be set because an application can request no reserves be made for hugetlbfs
> > at the risk of getting killed later.
> > 
> > With commit fc8744adc870a8d4366908221508bb113d8b72ee, VM_NORESERVE and
> > VM_ACCOUNT are getting unconditionally set for hugetlbfs-backed mappings. This
> > breaks the accounting for both the core VM and hugetlbfs, can trigger an
> > OOM storm when hugepage pools are too small lockups and corrupted counters
> > otherwise are used. This patch brings hugetlbfs more in line with how the
> > core VM treats VM_NORESERVE but prevents VM_ACCOUNT being set.
> > 
> > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> > --- 
> >  fs/hugetlbfs/inode.c    |    8 +++++---
> >  include/linux/hugetlb.h |    5 +++--
> >  include/linux/mm.h      |    3 +--
> >  ipc/shm.c               |    8 +++++---
> >  mm/fremap.c             |    2 +-
> >  mm/hugetlb.c            |   39 +++++++++++++++++++++++++--------------
> >  mm/mmap.c               |   38 ++++++++++++++++++++++----------------
> >  mm/mprotect.c           |    5 +++--
> >  8 files changed, 65 insertions(+), 43 deletions(-)
> > 
> > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> > index 6903d37..9b800d9 100644
> > --- a/fs/hugetlbfs/inode.c
> > +++ b/fs/hugetlbfs/inode.c
> > @@ -108,7 +108,8 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
> >  
> >  	if (hugetlb_reserve_pages(inode,
> >  				vma->vm_pgoff >> huge_page_order(h),
> > -				len >> huge_page_shift(h), vma))
> > +				len >> huge_page_shift(h), vma,
> > +				vma->vm_flags))
> >  		goto out;
> >  
> >  	ret = 0;
> > @@ -947,7 +948,7 @@ static int can_do_hugetlb_shm(void)
> >  			can_do_mlock());
> >  }
> >  
> > -struct file *hugetlb_file_setup(const char *name, size_t size)
> > +struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
> >  {
> >  	int error = -ENOMEM;
> >  	struct file *file;
> > @@ -981,7 +982,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size)
> >  
> >  	error = -ENOMEM;
> >  	if (hugetlb_reserve_pages(inode, 0,
> > -			size >> huge_page_shift(hstate_inode(inode)), NULL))
> > +			size >> huge_page_shift(hstate_inode(inode)), NULL,
> > +			acctflag))
> >  		goto out_inode;
> >  
> >  	d_instantiate(dentry, inode);
> > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> > index f1d2fba..af09660 100644
> > --- a/include/linux/hugetlb.h
> > +++ b/include/linux/hugetlb.h
> > @@ -33,7 +33,8 @@ unsigned long hugetlb_total_pages(void);
> >  int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
> >  			unsigned long address, int write_access);
> >  int hugetlb_reserve_pages(struct inode *inode, long from, long to,
> > -						struct vm_area_struct *vma);
> > +						struct vm_area_struct *vma,
> > +						int acctflags);
> >  void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
> >  
> >  extern unsigned long hugepages_treat_as_movable;
> > @@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
> >  
> >  extern const struct file_operations hugetlbfs_file_operations;
> >  extern struct vm_operations_struct hugetlb_vm_ops;
> > -struct file *hugetlb_file_setup(const char *name, size_t);
> > +struct file *hugetlb_file_setup(const char *name, size_t, int);
> >  int hugetlb_get_quota(struct address_space *mapping, long delta);
> >  void hugetlb_put_quota(struct address_space *mapping, long delta);
> >  
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index e8ddc98..3235615 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -1129,8 +1129,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
> >  	unsigned long flag, unsigned long pgoff);
> >  extern unsigned long mmap_region(struct file *file, unsigned long addr,
> >  	unsigned long len, unsigned long flags,
> > -	unsigned int vm_flags, unsigned long pgoff,
> > -	int accountable);
> > +	unsigned int vm_flags, unsigned long pgoff);
> >  
> >  static inline unsigned long do_mmap(struct file *file, unsigned long addr,
> >  	unsigned long len, unsigned long prot,
> > diff --git a/ipc/shm.c b/ipc/shm.c
> > index f8f69fa..05d51d2 100644
> > --- a/ipc/shm.c
> > +++ b/ipc/shm.c
> > @@ -340,6 +340,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
> >  	struct file * file;
> >  	char name[13];
> >  	int id;
> > +	int acctflag = 0;
> >  
> >  	if (size < SHMMIN || size > ns->shm_ctlmax)
> >  		return -EINVAL;
> > @@ -364,11 +365,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
> >  
> >  	sprintf (name, "SYSV%08x", key);
> >  	if (shmflg & SHM_HUGETLB) {
> > -		/* hugetlb_file_setup takes care of mlock user accounting */
> > -		file = hugetlb_file_setup(name, size);
> > +		/* hugetlb_file_setup applies strict accounting */
> > +		if (shmflg & SHM_NORESERVE)
> > +			acctflag = VM_NORESERVE;
> > +		file = hugetlb_file_setup(name, size, acctflag);
> 
> Does this change semantics?  At first look it appears that you are now
> implementing SHM_NORESERVE for SHM_HUGETLB where we did not previously
> do so?  Not that this is necesarily a bad thing, just feels like its
> changing.
> 

Yes, semantics for shared mappings are changed so that they obey
SHM_NORESERVE. This was part of bringing hugetlbfs closer to the
behaviour of the core VM but I should have called it out better in the
changelog.

> >  		shp->mlock_user = current_user();
> >  	} else {
> > -		int acctflag = 0;
> >  		/*
> >  		 * Do not allow no accounting for OVERCOMMIT_NEVER, even
> >  	 	 * if it's asked for.
> > diff --git a/mm/fremap.c b/mm/fremap.c
> > index 736ba7f..b6ec85a 100644
> > --- a/mm/fremap.c
> > +++ b/mm/fremap.c
> > @@ -198,7 +198,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
> >  			flags &= MAP_NONBLOCK;
> >  			get_file(file);
> >  			addr = mmap_region(file, start, size,
> > -					flags, vma->vm_flags, pgoff, 1);
> > +					flags, vma->vm_flags, pgoff);
> >  			fput(file);
> >  			if (IS_ERR_VALUE(addr)) {
> >  				err = addr;
> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > index 618e983..2074642 100644
> > --- a/mm/hugetlb.c
> > +++ b/mm/hugetlb.c
> > @@ -2269,14 +2269,12 @@ void hugetlb_change_protection(struct vm_area_struct *vma,
> >  
> >  int hugetlb_reserve_pages(struct inode *inode,
> >  					long from, long to,
> > -					struct vm_area_struct *vma)
> > +					struct vm_area_struct *vma,
> > +					int acctflag)
> >  {
> > -	long ret, chg;
> > +	long ret = 0, chg;
> >  	struct hstate *h = hstate_inode(inode);
> >  
> > -	if (vma && vma->vm_flags & VM_NORESERVE)
> > -		return 0;
> > -
> >  	/*
> >  	 * Shared mappings base their reservation on the number of pages that
> >  	 * are already allocated on behalf of the file. Private mappings need
> > @@ -2285,22 +2283,25 @@ int hugetlb_reserve_pages(struct inode *inode,
> >  	 */
> >  	if (!vma || vma->vm_flags & VM_SHARED)
> >  		chg = region_chg(&inode->i_mapping->private_list, from, to);
> 
> I thought the region map for a VM_SHARED mapping is meant to contain
> those pages for which we already have a reservation allocated.  So that
> if we have overlapping VM_RESERVE and VM_NORESERVE mappings we know that
> we did have a page reserved at fault time and know whether we can take
> it from the reserve portion of the pool.  By letting this get executed
> for VM_NORESERVE mappings that would seem to be getting out of sync,
> which doesn't sound right. 

This part doesn't get executed for NORESERVE so while region_chg() took
place to calculate a reservation, region_add() did not get called to
commit it.

> I don't see any updates to the documentation
> on the meanings of reservation map if you are changing it?
> 
> Here is the commentry from mm/hugetlb.c:
> 
>  * The private mapping reservation is represented in a subtly different
>  * manner to a shared mapping.  A shared mapping has a region map associated
>  * with the underlying file, this region map represents the backing file
>  * pages which have ever had a reservation assigned which this persists even
>  * after the page is instantiated.  A private mapping has a region map
>  * associated with the original mmap which is attached to all VMAs which
>  * reference it, this region map represents those offsets which have consumed
>  * reservation ie. where pages have been instantiated.
> 

This is still accurate.

> > -	else {
> > -		struct resv_map *resv_map = resv_map_alloc();
> > -		if (!resv_map)
> > -			return -ENOMEM;
> > -
> > +	else
> >  		chg = to - from;
> >  
> > -		set_vma_resv_map(vma, resv_map);
> > -		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
> > -	}
> > -
> >  	if (chg < 0)
> >  		return chg;
> >  
> >  	if (hugetlb_get_quota(inode->i_mapping, chg))
> >  		return -ENOSPC;
> > +
> > +	/*
> > +	 * Only apply hugepage reservation if asked. We still have to
> > +	 * take the filesystem quota because it is an upper limit
> > +	 * defined for the mount and not necessarily memory as a whole
> > +	 */
> > +	if (acctflag & VM_NORESERVE) {
> > +		reset_vma_resv_huge_pages(vma);
> 
> Why do we now need to do this in the non-reserve case?  We didn't need
> to do it before.
> 

True, it was largely defensive against anything being in page_private
that would make it think it had reserves. 

> > +		return 0;
> > +	}
> > +
> 
> This also seems like a semantic change.  Previously NO_RESERVE did not
> take quota, now it does.  NO_RESERVE used to mean that we took our
> chances on there being pages available at fault time both for quota and
> in the pools. Now it means that we only risk there being no pages.
> Does that not significantly change semantics. 

Yes, and this was a mistake. For noreserve mappings, we may now be taking
twice the amount of quota and probably leaking it. This is wrong and I need
to move the check for quota below the check for VM_NORESERVE. Good spot.

> The main use case for
> NO_RESERVE was mapping a massive area to expand into, this might now be
> refused for quota when previously it was not.
> 
> >  	ret = hugetlb_acct_memory(h, chg);
> >  	if (ret < 0) {
> >  		hugetlb_put_quota(inode->i_mapping, chg);
> > @@ -2308,6 +2309,16 @@ int hugetlb_reserve_pages(struct inode *inode,
> >  	}
> >  	if (!vma || vma->vm_flags & VM_SHARED)
> >  		region_add(&inode->i_mapping->private_list, from, to);
> > +	else {
> > +		struct resv_map *resv_map = resv_map_alloc();
> > +
> > +		if (!resv_map)
> > +			return -ENOMEM;
> > +
> > +		set_vma_resv_map(vma, resv_map);
> > +		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
> > +	}
> > +
> >  	return 0;
> >  }
> >  
> > diff --git a/mm/mmap.c b/mm/mmap.c
> > index 214b6a2..6f70db8 100644
> > --- a/mm/mmap.c
> > +++ b/mm/mmap.c
> > @@ -918,7 +918,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
> >  	struct inode *inode;
> >  	unsigned int vm_flags;
> >  	int error;
> > -	int accountable = 1;
> >  	unsigned long reqprot = prot;
> >  
> >  	/*
> > @@ -1019,8 +1018,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
> >  					return -EPERM;
> >  				vm_flags &= ~VM_MAYEXEC;
> >  			}
> > -			if (is_file_hugepages(file))
> > -				accountable = 0;
> >  
> >  			if (!file->f_op || !file->f_op->mmap)
> >  				return -ENODEV;
> > @@ -1053,8 +1050,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
> >  	if (error)
> >  		return error;
> >  
> > -	return mmap_region(file, addr, len, flags, vm_flags, pgoff,
> > -			   accountable);
> > +	return mmap_region(file, addr, len, flags, vm_flags, pgoff);
> >  }
> >  EXPORT_SYMBOL(do_mmap_pgoff);
> >  
> > @@ -1092,17 +1088,23 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
> >  
> >  /*
> >   * We account for memory if it's a private writeable mapping,
> > - * and VM_NORESERVE wasn't set.
> > + * not hugepages and VM_NORESERVE wasn't set.
> >   */
> > -static inline int accountable_mapping(unsigned int vm_flags)
> > +static inline int accountable_mapping(struct file *file, unsigned int vm_flags)
> >  {
> > +	/*
> > +	 * hugetlb has its own accounting separate from the core VM
> > +	 * VM_HUGETLB may not be set yet so we cannot check for that flag.
> > +	 */
> > +	if (file && is_file_hugepages(file))
> > +		return 0;
> > +
> >  	return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE;
> >  }
> >  
> >  unsigned long mmap_region(struct file *file, unsigned long addr,
> >  			  unsigned long len, unsigned long flags,
> > -			  unsigned int vm_flags, unsigned long pgoff,
> > -			  int accountable)
> > +			  unsigned int vm_flags, unsigned long pgoff)
> >  {
> >  	struct mm_struct *mm = current->mm;
> >  	struct vm_area_struct *vma, *prev;
> > @@ -1128,18 +1130,22 @@ munmap_back:
> >  
> >  	/*
> >  	 * Set 'VM_NORESERVE' if we should not account for the
> > -	 * memory use of this mapping. We only honor MAP_NORESERVE
> > -	 * if we're allowed to overcommit memory.
> > +	 * memory use of this mapping.
> >  	 */
> > -	if ((flags & MAP_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER)
> > -		vm_flags |= VM_NORESERVE;
> > -	if (!accountable)
> > -		vm_flags |= VM_NORESERVE;
> > +	if ((flags & MAP_NORESERVE)) {
> > +	 	/* * We honor MAP_NORESERVE if allowed to overcommit */
> > +		if (sysctl_overcommit_memory != OVERCOMMIT_NEVER)
> > +			vm_flags |= VM_NORESERVE;
> > +
> > +		/* hugetlb applies strict overcommit unless MAP_NORESERVE */
> > +		if (file && is_file_hugepages(file))
> > +			vm_flags |= VM_NORESERVE;
> > +	}
> >  
> >  	/*
> >  	 * Private writable mapping: check memory availability
> >  	 */
> > -	if (accountable_mapping(vm_flags)) {
> > +	if (accountable_mapping(file, vm_flags)) {
> >  		charged = len >> PAGE_SHIFT;
> >  		if (security_vm_enough_memory(charged))
> >  			return -ENOMEM;
> > diff --git a/mm/mprotect.c b/mm/mprotect.c
> > index abe2694..258197b 100644
> > --- a/mm/mprotect.c
> > +++ b/mm/mprotect.c
> > @@ -151,10 +151,11 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
> >  	/*
> >  	 * If we make a private mapping writable we increase our commit;
> >  	 * but (without finer accounting) cannot reduce our commit if we
> > -	 * make it unwritable again.
> > +	 * make it unwritable again. hugetlb mapping were accounted for
> > +	 * even if read-only so there is no need to account for them here
> >  	 */
> >  	if (newflags & VM_WRITE) {
> > -		if (!(oldflags & (VM_ACCOUNT|VM_WRITE|
> > +		if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_HUGETLB|
> >  						VM_SHARED|VM_NORESERVE))) {
> >  			charged = nrpages;
> >  			if (security_vm_enough_memory(charged))
> > 
> 

Thanks, I'll get the quota thing fixed up.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-10 23:45   ` Andrew Morton
@ 2009-02-11 11:15     ` Mel Gorman
  0 siblings, 0 replies; 50+ messages in thread
From: Mel Gorman @ 2009-02-11 11:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: torvalds, linux-kernel, kosaki.motohiro, hugh, Lee.Schermerhorn,
	gregkh, maksim.yevmenkin, npiggin, will, riel, kamezawa.hiroyu,
	miklos, apw, wli

On Tue, Feb 10, 2009 at 03:45:49PM -0800, Andrew Morton wrote:
> On Tue, 10 Feb 2009 14:02:27 +0000
> Mel Gorman <mel@csn.ul.ie> wrote:
> 
> > On Sun, Feb 08, 2009 at 01:01:04PM -0800, Linus Torvalds wrote:
> > > 
> > > Another week (and a half), another -rc.
> > > 
> > > Arch updates (sparc, blackfin), driver updates (dvb, mmc, ide), ACPI 
> > > updates, FS updates (ubifs, btrfs), you name it. It's all there.
> > > 
> > > But more importantly, people really have been working on regressions, and 
> > > hopefully this closes a nice set of the top one, and hopefully without 
> > > introducing too many new ones.
> > > 
> > 
> > Hugepages are currently busted due to commit
> > fc8744adc870a8d4366908221508bb113d8b72ee and the problem is in
> > 2.6.29-rc4. There was a bit of a discussion but it didn't get very far and
> > then I went offline for the weekend. Here is a revised patch that tries to
> > bring hugetlbfs more in line with what the core VM is doing by dealing with
> > VM_ACCOUNT and VM_NORESERVE.
> > 
> > =============
> > Do not account for the address space used by hugetlbfs using VM_ACCOUNT
> > 
> > When overcommit is disabled, the core VM accounts for pages used by anonymous
> > shared, private mappings and special mappings. It keeps track of VMAs that
> > should be accounted for with VM_ACCOUNT and VMAs that never had a reserve
> > with VM_NORESERVE.
> > 
> > Overcommit for hugetlbfs is much riskier than overcommit for base pages
> > due to contiguity requirements. It avoids overcommiting on both shared and
> > private mappings using reservation counters that are checked and updated
> > during mmap(). This ensures (within limits) that hugepages exist in the
> > future when faults occurs or it is too easy to applications to be SIGKILLed.
> > 
> > As hugetlbfs makes its own reservations of a different unit to the base page
> > size, VM_ACCOUNT should never be set. Even if the units were correct, we would
> > double account for the usage in the core VM and hugetlbfs. VM_NORESERVE may
> > be set because an application can request no reserves be made for hugetlbfs
> > at the risk of getting killed later.
> > 
> > With commit fc8744adc870a8d4366908221508bb113d8b72ee, VM_NORESERVE and
> > VM_ACCOUNT are getting unconditionally set for hugetlbfs-backed mappings. This
> > breaks the accounting for both the core VM and hugetlbfs, can trigger an
> > OOM storm when hugepage pools are too small lockups and corrupted counters
> > otherwise are used. This patch brings hugetlbfs more in line with how the
> > core VM treats VM_NORESERVE but prevents VM_ACCOUNT being set.
> > 
> > ...
> >
> > --- a/fs/hugetlbfs/inode.c
> > +++ b/fs/hugetlbfs/inode.c
> > @@ -108,7 +108,8 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
> >  
> >  	if (hugetlb_reserve_pages(inode,
> >  				vma->vm_pgoff >> huge_page_order(h),
> > -				len >> huge_page_shift(h), vma))
> > +				len >> huge_page_shift(h), vma,
> > +				vma->vm_flags))
> >  		goto out;
> >  
> >  	ret = 0;
> > @@ -947,7 +948,7 @@ static int can_do_hugetlb_shm(void)
> >  			can_do_mlock());
> >  }
> >  
> > -struct file *hugetlb_file_setup(const char *name, size_t size)
> > +struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
> 
> This superundocumented acctflag looks like a poorly-named boolean.  But
> it is fact a composition of VM_foo bits.
> 

It's matching naming at the call site. The call to shmem_file_setup()
looks like

	file = shmem_file_setup(name, size, acctflag);

so, the call to hugetlb_file_setup looks like

	hugetlb_file_setup(name, size, acctflag);

and the name in the signature matches. shmem doesn't match like this, it
just called its parameter "flags" and uses a different unit for size. The
different in unit is bad in itself and I need to check that out.

> Would it not be clearer to name it `vm_flags'?

It's not all the flags either so vm_flags is confusing for other reasons.
At least, at the time of writing the flags were meant to be VM_ACCOUNT and
VM_NORESERVE but in reality, only VM_NORESERVE appears to be sent in but
maybe that will change. 

That said..... newseg() passes VM_NORESERVE as a flag to shmem_file_setup(). It
in turn checks for VM_ACCOUNT in shmem_acct_size(), not VM_NORESERVE. Right
now we may have an issue there too. Later it uses shmem_acct_block() but at
that point VM_ACCOUNT has been set properly. shmem also has a VM_ACCT macro
that has very little to do with VM_ACCOUNT. Naming rocks.

I'll look at a patch that makes the signatures of *_file_setup() match. I'll
then check if it should be vm_acct_flags (both VM_ACCOUNT and VM_NORESERVE
possible) or vm_resv_flag (VM_NORESERVE only).

> 
> >  {
> >  	int error = -ENOMEM;
> >  	struct file *file;
> > @@ -981,7 +982,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size)
> >  
> >  	error = -ENOMEM;
> >  	if (hugetlb_reserve_pages(inode, 0,
> > -			size >> huge_page_shift(hstate_inode(inode)), NULL))
> > +			size >> huge_page_shift(hstate_inode(inode)), NULL,
> > +			acctflag))
> >  		goto out_inode;
> >  
> >  	d_instantiate(dentry, inode);
> > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> > index f1d2fba..af09660 100644
> > --- a/include/linux/hugetlb.h
> > +++ b/include/linux/hugetlb.h
> > @@ -33,7 +33,8 @@ unsigned long hugetlb_total_pages(void);
> >  int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
> >  			unsigned long address, int write_access);
> >  int hugetlb_reserve_pages(struct inode *inode, long from, long to,
> > -						struct vm_area_struct *vma);
> > +						struct vm_area_struct *vma,
> > +						int acctflags);
> 
> here it went plural.
> 

Because I was thinking of VM_ACCOUNT and VM_NORESERVE, hence plural.

> >  void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
> >  
> >  extern unsigned long hugepages_treat_as_movable;
> > @@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
> >  
> >  extern const struct file_operations hugetlbfs_file_operations;
> >  extern struct vm_operations_struct hugetlb_vm_ops;
> > -struct file *hugetlb_file_setup(const char *name, size_t);
> > +struct file *hugetlb_file_setup(const char *name, size_t, int);
> 
> Here it is omitted altogether.  We now have one named parameter and two
> secret ones.
> 

Dirt, that was matching what was happening for size_t but it's fugly. I
should have fixed size_t while I was there rather than making it look worse.

> Also, the patch forgot to update this:
> 
> #define hugetlb_file_setup(name,size)   ERR_PTR(-ENOSYS)
> 
> Which I assume breaks CONFIG_HUGETLBFS=n.
> 

Yeah, it broke and has been fixed since.

> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index e8ddc98..3235615 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -1129,8 +1129,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
> >  	unsigned long flag, unsigned long pgoff);
> >  extern unsigned long mmap_region(struct file *file, unsigned long addr,
> >  	unsigned long len, unsigned long flags,
> > -	unsigned int vm_flags, unsigned long pgoff,
> > -	int accountable);
> > +	unsigned int vm_flags, unsigned long pgoff);
> 
> And there is a vm_flags which has type `unsigned int'.
> 
> Your newly-added should-have-been-called-vm_flags has type `int'.
> 
> The vm_flagses in `struct vm_region' and `struct vm_area_struct' have type
> `unsigned long'.
> 

Yes, they all should have been unsigned long.

> It'd be nice to get these consistent.  We only have two bits left in
> the vm_flags namespace so arguably we could add a vm_flags_t while
> fixing this up, with a view to makeing it u64 later.  Maybe.
> 

I'll look at a vm_flags_t that works similar in principal to gfp_t and making
the signatures match up.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-11 10:30     ` Mel Gorman
@ 2009-02-11 12:03       ` Andy Whitcroft
  2009-02-11 14:20         ` Mel Gorman
  0 siblings, 1 reply; 50+ messages in thread
From: Andy Whitcroft @ 2009-02-11 12:03 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

On Wed, Feb 11, 2009 at 10:30:01AM +0000, Mel Gorman wrote:

> > >  	/*
> > >  	 * Shared mappings base their reservation on the number of pages that
> > >  	 * are already allocated on behalf of the file. Private mappings need
> > > @@ -2285,22 +2283,25 @@ int hugetlb_reserve_pages(struct inode *inode,
> > >  	 */
> > >  	if (!vma || vma->vm_flags & VM_SHARED)
> > >  		chg = region_chg(&inode->i_mapping->private_list, from, to);
> > 
> > I thought the region map for a VM_SHARED mapping is meant to contain
> > those pages for which we already have a reservation allocated.  So that
> > if we have overlapping VM_RESERVE and VM_NORESERVE mappings we know that
> > we did have a page reserved at fault time and know whether we can take
> > it from the reserve portion of the pool.  By letting this get executed
> > for VM_NORESERVE mappings that would seem to be getting out of sync,
> > which doesn't sound right. 
> 
> This part doesn't get executed for NORESERVE so while region_chg() took
> place to calculate a reservation, region_add() did not get called to
> commit it.

Bah I wrote those damn routines and even I get confused.  As you say
they are a prepare/commit pair and this is only the prepare phase you
are executing, no persistant change is made; so its safe.

> > > +	if (acctflag & VM_NORESERVE) {
> > > +		reset_vma_resv_huge_pages(vma);
> > 
> > Why do we now need to do this in the non-reserve case?  We didn't need
> > to do it before.
> > 
> 
> True, it was largely defensive against anything being in page_private
> that would make it think it had reserves. 

Defensive is good.

> > > +		return 0;
> > > +	}
> > > +
> > 
> > This also seems like a semantic change.  Previously NO_RESERVE did not
> > take quota, now it does.  NO_RESERVE used to mean that we took our
> > chances on there being pages available at fault time both for quota and
> > in the pools. Now it means that we only risk there being no pages.
> > Does that not significantly change semantics. 
> 
> Yes, and this was a mistake. For noreserve mappings, we may now be taking
> twice the amount of quota and probably leaking it. This is wrong and I need
> to move the check for quota below the check for VM_NORESERVE. Good spot.

Thanks.

-apw

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-11 12:03       ` Andy Whitcroft
@ 2009-02-11 14:20         ` Mel Gorman
  2009-02-11 16:03           ` Andy Whitcroft
  0 siblings, 1 reply; 50+ messages in thread
From: Mel Gorman @ 2009-02-11 14:20 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

On Wed, Feb 11, 2009 at 12:03:17PM +0000, Andy Whitcroft wrote:
> > <SNIP>
> >
> > Yes, and this was a mistake. For noreserve mappings, we may now be taking
> > twice the amount of quota and probably leaking it. This is wrong and I need
> > to move the check for quota below the check for VM_NORESERVE. Good spot.
> 
> Thanks.
> 

How about this?

=====
[PATCH] Do not account for hugetlbfs quota at mmap() time if mapping *_NORESERVE

Commit 5a6fe125950676015f5108fb71b2a67441755003 brought hugetlbfs more in line
with the core VM by obeying VM_NORESERVE and not reserving hugepages for both
shared and private mappings when [SHM|MAP]_NORESERVE are specified. However,
it is still taking filesystem quota unconditionally and this leads to
double-accounting.

At fault time, if there are no reserves and attempt is made to allocate the
page and account for filesystem quota. If either fail, the fault fails. This
patch prevents quota being taken when [SHM|MAP]_NORESERVE is specified.
To help prevent this mistake happening again, it improves the documentation
of hugetlb_reserve_pages().

Reported-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
--- 
 hugetlb.c |   29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2074642..b0b63cd 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2289,24 +2289,41 @@ int hugetlb_reserve_pages(struct inode *inode,
 	if (chg < 0)
 		return chg;
 
-	if (hugetlb_get_quota(inode->i_mapping, chg))
-		return -ENOSPC;
-
 	/*
-	 * Only apply hugepage reservation if asked. We still have to
-	 * take the filesystem quota because it is an upper limit
-	 * defined for the mount and not necessarily memory as a whole
+	 * Only apply hugepage reservation if asked. At fault time, an
+	 * attempt will be made for VM_NORESERVE to allocate a page
+	 * and filesystem quota without using reserves
 	 */
 	if (acctflag & VM_NORESERVE) {
 		reset_vma_resv_huge_pages(vma);
 		return 0;
 	}
 
+	/* There must be enough filesystem quota for the mapping */
+	if (hugetlb_get_quota(inode->i_mapping, chg))
+		return -ENOSPC;
+
+	/*
+	 * Check enough hugepages are available for the reservation.
+	 * Hand back the quota if there are not
+	 */
 	ret = hugetlb_acct_memory(h, chg);
 	if (ret < 0) {
 		hugetlb_put_quota(inode->i_mapping, chg);
 		return ret;
 	}
+
+	/*
+	 * Account for the reservations made. Shared mappings record regions
+	 * that have reservations as they are shared by multiple VMAs.
+	 * When the last VMA disappears, the region map says how much
+	 * the reservation was and the page cache tells how much of
+	 * the reservation was consumed. Private mappings are per-VMA and
+	 * only the consumed reservations are tracked. When the VMA
+	 * disappears, the original reservation is the VMA size and the
+	 * consumed reservations are stored in the map. Here, we just need
+	 * to allocate the region map.
+	 */
 	if (!vma || vma->vm_flags & VM_SHARED)
 		region_add(&inode->i_mapping->private_list, from, to);
 	else {

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-11 14:20         ` Mel Gorman
@ 2009-02-11 16:03           ` Andy Whitcroft
  2009-02-11 16:34             ` Mel Gorman
  0 siblings, 1 reply; 50+ messages in thread
From: Andy Whitcroft @ 2009-02-11 16:03 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

On Wed, Feb 11, 2009 at 02:20:04PM +0000, Mel Gorman wrote:
> On Wed, Feb 11, 2009 at 12:03:17PM +0000, Andy Whitcroft wrote:
> > > <SNIP>
> > >
> > > Yes, and this was a mistake. For noreserve mappings, we may now be taking
> > > twice the amount of quota and probably leaking it. This is wrong and I need
> > > to move the check for quota below the check for VM_NORESERVE. Good spot.
> > 
> > Thanks.
> > 
> 
> How about this?
> 
> =====
> [PATCH] Do not account for hugetlbfs quota at mmap() time if mapping *_NORESERVE
> 
> Commit 5a6fe125950676015f5108fb71b2a67441755003 brought hugetlbfs more in line
> with the core VM by obeying VM_NORESERVE and not reserving hugepages for both
> shared and private mappings when [SHM|MAP]_NORESERVE are specified. However,
> it is still taking filesystem quota unconditionally and this leads to
> double-accounting.
> 
> At fault time, if there are no reserves and attempt is made to allocate the
> page and account for filesystem quota. If either fail, the fault fails. This
> patch prevents quota being taken when [SHM|MAP]_NORESERVE is specified.
> To help prevent this mistake happening again, it improves the documentation
> of hugetlb_reserve_pages().
> 
> Reported-by: Andy Whitcroft <apw@canonical.com>
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> --- 
>  hugetlb.c |   29 +++++++++++++++++++++++------
>  1 file changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 2074642..b0b63cd 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2289,24 +2289,41 @@ int hugetlb_reserve_pages(struct inode *inode,
>  	if (chg < 0)
>  		return chg;
>  
> -	if (hugetlb_get_quota(inode->i_mapping, chg))
> -		return -ENOSPC;
> -
>  	/*
> -	 * Only apply hugepage reservation if asked. We still have to
> -	 * take the filesystem quota because it is an upper limit
> -	 * defined for the mount and not necessarily memory as a whole
> +	 * Only apply hugepage reservation if asked. At fault time, an
> +	 * attempt will be made for VM_NORESERVE to allocate a page
> +	 * and filesystem quota without using reserves
>  	 */
>  	if (acctflag & VM_NORESERVE) {
>  		reset_vma_resv_huge_pages(vma);
>  		return 0;
>  	}
>  
> +	/* There must be enough filesystem quota for the mapping */
> +	if (hugetlb_get_quota(inode->i_mapping, chg))
> +		return -ENOSPC;
> +
> +	/*
> +	 * Check enough hugepages are available for the reservation.
> +	 * Hand back the quota if there are not
> +	 */
>  	ret = hugetlb_acct_memory(h, chg);
>  	if (ret < 0) {
>  		hugetlb_put_quota(inode->i_mapping, chg);
>  		return ret;
>  	}
> +
> +	/*
> +	 * Account for the reservations made. Shared mappings record regions
> +	 * that have reservations as they are shared by multiple VMAs.
> +	 * When the last VMA disappears, the region map says how much
> +	 * the reservation was and the page cache tells how much of

how much of the area had a reservation and the page cache ...

> +	 * the reservation was consumed. Private mappings are per-VMA and
> +	 * only the consumed reservations are tracked. When the VMA
> +	 * disappears, the original reservation is the VMA size and the
> +	 * consumed reservations are stored in the map. Here, we just need
> +	 * to allocate the region map.
> +	 */
>  	if (!vma || vma->vm_flags & VM_SHARED)
>  		region_add(&inode->i_mapping->private_list, from, to);
>  	else {

I am worried about the failure semantics here.  For shared mappings we
alloc any memory we need with region_chg(), then take quota, then apply
it and done.  For private mappings we take the quota and then allocate
any memory we need.  If that fails we do not return the quota?  Sounds
like a quota leak to me?

I think we do need to allocate the private map up when we do the
region_chg() for the shared case.  And I think neither of those is needed
for NORESERVE mappings?

-apw

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-11 16:03           ` Andy Whitcroft
@ 2009-02-11 16:34             ` Mel Gorman
  2009-02-11 16:43               ` Andy Whitcroft
  0 siblings, 1 reply; 50+ messages in thread
From: Mel Gorman @ 2009-02-11 16:34 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

On Wed, Feb 11, 2009 at 04:03:40PM +0000, Andy Whitcroft wrote:
> On Wed, Feb 11, 2009 at 02:20:04PM +0000, Mel Gorman wrote:
> > On Wed, Feb 11, 2009 at 12:03:17PM +0000, Andy Whitcroft wrote:
> > > > <SNIP>
> > > >
> > > > Yes, and this was a mistake. For noreserve mappings, we may now be taking
> > > > twice the amount of quota and probably leaking it. This is wrong and I need
> > > > to move the check for quota below the check for VM_NORESERVE. Good spot.
> > > 
> > > Thanks.
> > > 
> > 
> > How about this?
> > 
> > =====
> > [PATCH] Do not account for hugetlbfs quota at mmap() time if mapping *_NORESERVE
> > 
> > Commit 5a6fe125950676015f5108fb71b2a67441755003 brought hugetlbfs more in line
> > with the core VM by obeying VM_NORESERVE and not reserving hugepages for both
> > shared and private mappings when [SHM|MAP]_NORESERVE are specified. However,
> > it is still taking filesystem quota unconditionally and this leads to
> > double-accounting.
> > 
> > At fault time, if there are no reserves and attempt is made to allocate the
> > page and account for filesystem quota. If either fail, the fault fails. This
> > patch prevents quota being taken when [SHM|MAP]_NORESERVE is specified.
> > To help prevent this mistake happening again, it improves the documentation
> > of hugetlb_reserve_pages().
> > 
> > Reported-by: Andy Whitcroft <apw@canonical.com>
> > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> > --- 
> >  hugetlb.c |   29 +++++++++++++++++++++++------
> >  1 file changed, 23 insertions(+), 6 deletions(-)
> > 
> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > index 2074642..b0b63cd 100644
> > --- a/mm/hugetlb.c
> > +++ b/mm/hugetlb.c
> > @@ -2289,24 +2289,41 @@ int hugetlb_reserve_pages(struct inode *inode,
> >  	if (chg < 0)
> >  		return chg;
> >  
> > -	if (hugetlb_get_quota(inode->i_mapping, chg))
> > -		return -ENOSPC;
> > -
> >  	/*
> > -	 * Only apply hugepage reservation if asked. We still have to
> > -	 * take the filesystem quota because it is an upper limit
> > -	 * defined for the mount and not necessarily memory as a whole
> > +	 * Only apply hugepage reservation if asked. At fault time, an
> > +	 * attempt will be made for VM_NORESERVE to allocate a page
> > +	 * and filesystem quota without using reserves
> >  	 */
> >  	if (acctflag & VM_NORESERVE) {
> >  		reset_vma_resv_huge_pages(vma);
> >  		return 0;
> >  	}
> >  
> > +	/* There must be enough filesystem quota for the mapping */
> > +	if (hugetlb_get_quota(inode->i_mapping, chg))
> > +		return -ENOSPC;
> > +
> > +	/*
> > +	 * Check enough hugepages are available for the reservation.
> > +	 * Hand back the quota if there are not
> > +	 */
> >  	ret = hugetlb_acct_memory(h, chg);
> >  	if (ret < 0) {
> >  		hugetlb_put_quota(inode->i_mapping, chg);
> >  		return ret;
> >  	}
> > +
> > +	/*
> > +	 * Account for the reservations made. Shared mappings record regions
> > +	 * that have reservations as they are shared by multiple VMAs.
> > +	 * When the last VMA disappears, the region map says how much
> > +	 * the reservation was and the page cache tells how much of
> 
> how much of the area had a reservation and the page cache ...
> 
> > +	 * the reservation was consumed. Private mappings are per-VMA and
> > +	 * only the consumed reservations are tracked. When the VMA
> > +	 * disappears, the original reservation is the VMA size and the
> > +	 * consumed reservations are stored in the map. Here, we just need
> > +	 * to allocate the region map.
> > +	 */
> >  	if (!vma || vma->vm_flags & VM_SHARED)
> >  		region_add(&inode->i_mapping->private_list, from, to);
> >  	else {
> 
> I am worried about the failure semantics here.  For shared mappings we
> alloc any memory we need with region_chg(), then take quota, then apply
> it and done.  For private mappings we take the quota and then allocate
> any memory we need.  If that fails we do not return the quota?  Sounds
> like a quota leak to me?
> 

It is a quota leak.

> I think we do need to allocate the private map up when we do the
> region_chg() for the shared case.  And I think neither of those is needed
> for NORESERVE mappings?
> 

Right. This shuffle was based on the assumption quota mattered and had to
be accounted for. As you have pointed out, this was wrong and so all the
shuffling was pointless. The correct thing to do is a partial revert of
the hunk that alters hugetlb_reserve_pages() and then add back acctflag to
check VM_NORESERVE so that SHM_NORESERVE still has meaning.

After the following patch is applied, the net change to hugetlb_reserve_pages()
is small - mainly additional comments documenting what's going on.

======
Subject: [PATCH] Do not account for hugetlbfs quota at mmap() time if mapping [SHM|MAP]_NORESERVE

Commit 5a6fe125950676015f5108fb71b2a67441755003 brought hugetlbfs more in line
with the core VM by obeying VM_NORESERVE and not reserving hugepages for both
shared and private mappings when [SHM|MAP]_NORESERVE are specified. However,
it is still taking filesystem quota unconditionally.

At fault time, if there are no reserves and attempt is made to allocate
the page and account for filesystem quota. If either fail, the fault
fails. The impact is that quota is getting accounted for twice. This patch
partially reverts 5a6fe125950676015f5108fb71b2a67441755003.  To help
prevent this mistake happening again, it improves the documentation of
hugetlb_reserve_pages()

Reported-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2074642..107da3d 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2272,10 +2272,18 @@ int hugetlb_reserve_pages(struct inode *inode,
 					struct vm_area_struct *vma,
 					int acctflag)
 {
-	long ret = 0, chg;
+	long ret, chg;
 	struct hstate *h = hstate_inode(inode);
 
 	/*
+	 * Only apply hugepage reservation if asked. At fault time, an
+	 * attempt will be made for VM_NORESERVE to allocate a page
+	 * and filesystem quota without using reserves
+	 */
+	if (acctflag & VM_NORESERVE)
+		return 0;
+
+	/*
 	 * Shared mappings base their reservation on the number of pages that
 	 * are already allocated on behalf of the file. Private mappings need
 	 * to reserve the full area even if read-only as mprotect() may be
@@ -2283,42 +2291,47 @@ int hugetlb_reserve_pages(struct inode *inode,
 	 */
 	if (!vma || vma->vm_flags & VM_SHARED)
 		chg = region_chg(&inode->i_mapping->private_list, from, to);
-	else
+	else {
+		struct resv_map *resv_map = resv_map_alloc();
+		if (!resv_map)
+			return -ENOMEM;
+
 		chg = to - from;
 
+		set_vma_resv_map(vma, resv_map);
+		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
+	}
+
 	if (chg < 0)
 		return chg;
 
+	/* There must be enough filesystem quota for the mapping */
 	if (hugetlb_get_quota(inode->i_mapping, chg))
 		return -ENOSPC;
 
 	/*
-	 * Only apply hugepage reservation if asked. We still have to
-	 * take the filesystem quota because it is an upper limit
-	 * defined for the mount and not necessarily memory as a whole
+	 * Check enough hugepages are available for the reservation.
+	 * Hand back the quota if there are not
 	 */
-	if (acctflag & VM_NORESERVE) {
-		reset_vma_resv_huge_pages(vma);
-		return 0;
-	}
-
 	ret = hugetlb_acct_memory(h, chg);
 	if (ret < 0) {
 		hugetlb_put_quota(inode->i_mapping, chg);
 		return ret;
 	}
+
+	/*
+	 * Account for the reservations made. Shared mappings record regions
+	 * that have reservations as they are shared by multiple VMAs.
+	 * When the last VMA disappears, the region map says how much
+	 * the reservation was and the page cache tells how much of
+	 * the reservation was consumed. Private mappings are per-VMA and
+	 * only the consumed reservations are tracked. When the VMA
+	 * disappears, the original reservation is the VMA size and the
+	 * consumed reservations are stored in the map. Hence, nothing
+	 * else has to be done for private mappings here
+	 */
 	if (!vma || vma->vm_flags & VM_SHARED)
 		region_add(&inode->i_mapping->private_list, from, to);
-	else {
-		struct resv_map *resv_map = resv_map_alloc();
-
-		if (!resv_map)
-			return -ENOMEM;
-
-		set_vma_resv_map(vma, resv_map);
-		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
-	}
-
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4)
  2009-02-11 16:34             ` Mel Gorman
@ 2009-02-11 16:43               ` Andy Whitcroft
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Whitcroft @ 2009-02-11 16:43 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Linus Torvalds, Linux Kernel Mailing List, KOSAKI Motohiro,
	Hugh Dickins, Lee Schermerhorn, Greg KH, Maksim Yevmenkin,
	Nick Piggin, Andrew Morton, will, Rik van Riel,
	KAMEZAWA Hiroyuki, Mikos Szeredi, wli

Acked-by: Andy Whitcroft <apw@canonical.com>

> Subject: [PATCH] Do not account for hugetlbfs quota at mmap() time if mapping [SHM|MAP]_NORESERVE
> 
> Commit 5a6fe125950676015f5108fb71b2a67441755003 brought hugetlbfs more in line
> with the core VM by obeying VM_NORESERVE and not reserving hugepages for both
> shared and private mappings when [SHM|MAP]_NORESERVE are specified. However,
> it is still taking filesystem quota unconditionally.
> 
> At fault time, if there are no reserves and attempt is made to allocate
> the page and account for filesystem quota. If either fail, the fault
> fails. The impact is that quota is getting accounted for twice. This patch
> partially reverts 5a6fe125950676015f5108fb71b2a67441755003.  To help
> prevent this mistake happening again, it improves the documentation of
> hugetlb_reserve_pages()
> 
> Reported-by: Andy Whitcroft <apw@canonical.com>
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 2074642..107da3d 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2272,10 +2272,18 @@ int hugetlb_reserve_pages(struct inode *inode,
>  					struct vm_area_struct *vma,
>  					int acctflag)
>  {
> -	long ret = 0, chg;
> +	long ret, chg;
>  	struct hstate *h = hstate_inode(inode);
>  
>  	/*
> +	 * Only apply hugepage reservation if asked. At fault time, an
> +	 * attempt will be made for VM_NORESERVE to allocate a page
> +	 * and filesystem quota without using reserves
> +	 */
> +	if (acctflag & VM_NORESERVE)
> +		return 0;
> +
> +	/*
>  	 * Shared mappings base their reservation on the number of pages that
>  	 * are already allocated on behalf of the file. Private mappings need
>  	 * to reserve the full area even if read-only as mprotect() may be
> @@ -2283,42 +2291,47 @@ int hugetlb_reserve_pages(struct inode *inode,
>  	 */
>  	if (!vma || vma->vm_flags & VM_SHARED)
>  		chg = region_chg(&inode->i_mapping->private_list, from, to);
> -	else
> +	else {
> +		struct resv_map *resv_map = resv_map_alloc();
> +		if (!resv_map)
> +			return -ENOMEM;
> +
>  		chg = to - from;
>  
> +		set_vma_resv_map(vma, resv_map);
> +		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
> +	}
> +
>  	if (chg < 0)
>  		return chg;
>  
> +	/* There must be enough filesystem quota for the mapping */
>  	if (hugetlb_get_quota(inode->i_mapping, chg))
>  		return -ENOSPC;
>  
>  	/*
> -	 * Only apply hugepage reservation if asked. We still have to
> -	 * take the filesystem quota because it is an upper limit
> -	 * defined for the mount and not necessarily memory as a whole
> +	 * Check enough hugepages are available for the reservation.
> +	 * Hand back the quota if there are not
>  	 */
> -	if (acctflag & VM_NORESERVE) {
> -		reset_vma_resv_huge_pages(vma);
> -		return 0;
> -	}
> -
>  	ret = hugetlb_acct_memory(h, chg);
>  	if (ret < 0) {
>  		hugetlb_put_quota(inode->i_mapping, chg);
>  		return ret;
>  	}
> +
> +	/*
> +	 * Account for the reservations made. Shared mappings record regions
> +	 * that have reservations as they are shared by multiple VMAs.
> +	 * When the last VMA disappears, the region map says how much
> +	 * the reservation was and the page cache tells how much of
> +	 * the reservation was consumed. Private mappings are per-VMA and
> +	 * only the consumed reservations are tracked. When the VMA
> +	 * disappears, the original reservation is the VMA size and the
> +	 * consumed reservations are stored in the map. Hence, nothing
> +	 * else has to be done for private mappings here
> +	 */
>  	if (!vma || vma->vm_flags & VM_SHARED)
>  		region_add(&inode->i_mapping->private_list, from, to);
> -	else {
> -		struct resv_map *resv_map = resv_map_alloc();
> -
> -		if (!resv_map)
> -			return -ENOMEM;
> -
> -		set_vma_resv_map(vma, resv_map);
> -		set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
> -	}
> -
>  	return 0;
>  }

-apw

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-10 16:03             ` Darren Salt
@ 2009-02-23 16:39                 ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-23 16:39 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds

Can you try this (entirely untested - I don't have access to the 
hardware right now) patch? It should register the eee code with the PCI 
hotplug core. With luck that'll avoid the oops.

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index b3866ad..75a560b 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -307,6 +307,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 786ed86..9e5fa4c 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 
@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };
 
 /* The actual device the driver binds to */
@@ -194,6 +196,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };
 
+/* PCI hotplug ops */
+static int eeepc_get_adapter_status (struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;
 
@@ -519,6 +530,19 @@ static void notify_brn(void)
 		bd->props.brightness = read_brightness(bd);
 }
 
+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct pci_dev *dev;
@@ -620,6 +644,53 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }
 
+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+	
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -700,11 +771,17 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}
 
+	result = eeepc_setup_pci_hotplug();
+	if (result)
+		goto pci_fail;
+
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
 
 	return 0;
-
+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -734,6 +811,8 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
 
+	pci_hp_deregister(ehotk->hotplug_slot);
+
 	kfree(ehotk);
 	return 0;
 }


-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-23 16:39                 ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-23 16:39 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary, Darren Salt

Can you try this (entirely untested - I don't have access to the 
hardware right now) patch? It should register the eee code with the PCI 
hotplug core. With luck that'll avoid the oops.

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index b3866ad..75a560b 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -307,6 +307,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 786ed86..9e5fa4c 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 
@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };
 
 /* The actual device the driver binds to */
@@ -194,6 +196,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };
 
+/* PCI hotplug ops */
+static int eeepc_get_adapter_status (struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;
 
@@ -519,6 +530,19 @@ static void notify_brn(void)
 		bd->props.brightness = read_brightness(bd);
 }
 
+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct pci_dev *dev;
@@ -620,6 +644,53 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }
 
+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+	
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -700,11 +771,17 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}
 
+	result = eeepc_setup_pci_hotplug();
+	if (result)
+		goto pci_fail;
+
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
 
 	return 0;
-
+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -734,6 +811,8 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
 
+	pci_hp_deregister(ehotk->hotplug_slot);
+
 	kfree(ehotk);
 	return 0;
 }


-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH 2.6.29-rc4] Restore ACPI reporting via /proc/acpi/events for EeePC & other Asus laptops.
  2009-02-10 14:54         ` Darren Salt
  (?)
@ 2009-02-24 11:31         ` Corentin Chary
  -1 siblings, 0 replies; 50+ messages in thread
From: Corentin Chary @ 2009-02-24 11:31 UTC (permalink / raw)
  To: Darren Salt
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Matthew Garrett

On Tuesday 10 February 2009 15:54:56 Darren Salt wrote:
> The descriptions for the following two commits
>   2a7dc0d8c60325e9bf820900bf919430e5a419ab (asus-laptop)
>   2b25c9f01aa58d48129b2f93748dfb5d1f7ab0a2 (eeepc-laptop)
> say that events should ALSO be exported via netlink, but the effect is that
> they are INSTEAD exported via netlink. The latter commit breaks use of
> acpid on my EeePC 901.

Hi,
There was already two patch for that on the ml

http://patchwork.kernel.org/patch/7356/
http://patchwork.kernel.org/patch/7357/

Thanks

-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-23 16:39                 ` Matthew Garrett
  (?)
@ 2009-02-24 15:29                 ` Darren Salt
  2009-02-24 16:00                     ` Matthew Garrett
  -1 siblings, 1 reply; 50+ messages in thread
From: Darren Salt @ 2009-02-24 15:29 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary

I demand that Matthew Garrett may or may not have written...

> Can you try this (entirely untested - I don't have access to the hardware
> right now) patch? It should register the eee code with the PCI hotplug
> core. With luck that'll avoid the oops.

> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index b3866ad..75a560b 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -307,6 +307,7 @@ config EEEPC_LAPTOP
>  	select BACKLIGHT_CLASS_DEVICE
>  	select HWMON
>  	select RFKILL
> +	select HOTPLUG_PCI

Not HOTPLUG_PCI_PCIE?

With that selected (I see no point in testing this otherwise) *and*
pciehp_force=1, I get -EBUSY when the hotplug slot registration is attempted
and no wireless, bluetooth or hot key reporting; wireless & bluetooth are
switched off at that point (I made sure that they were enabled via BIOS
setup). Without that option, all is fine.

(As usual with my kernel builds, these are built in.)

[snip]
-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Travel less. Share transport more.           PRODUCE LESS CARBON DIOXIDE.

The man who raises a fist has run out of ideas.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-24 15:29                 ` Darren Salt
@ 2009-02-24 16:00                     ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-24 16:00 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds

On Tue, Feb 24, 2009 at 03:29:36PM +0000, Darren Salt wrote:

> Not HOTPLUG_PCI_PCIE?

No - it just depends on the hotplug PCI core.

> With that selected (I see no point in testing this otherwise) *and*
> pciehp_force=1, I get -EBUSY when the hotplug slot registration is attempted
> and no wireless, bluetooth or hot key reporting; wireless & bluetooth are
> switched off at that point (I made sure that they were enabled via BIOS
> setup). Without that option, all is fine.

Right, so that sounds like everything works as expected. I guess to 
avoid breaking existing setups we should probably be a bit nicer there. 
Can you test whether this one works?

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index b3866ad..75a560b 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -307,6 +307,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 786ed86..e2412c9 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 
@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };
 
 /* The actual device the driver binds to */
@@ -194,6 +196,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };
 
+/* PCI hotplug ops */
+static int eeepc_get_adapter_status (struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;
 
@@ -519,6 +530,19 @@ static void notify_brn(void)
 		bd->props.brightness = read_brightness(bd);
 }
 
+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct pci_dev *dev;
@@ -620,6 +644,54 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }
 
+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+	
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+	ehotk->hotplug_slot = NULL;
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -700,11 +772,25 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}
 
+	result = eeepc_setup_pci_hotplug();
+
+	/*
+	 * If we get -EBUSY then something else is handling the PCI hotplug -
+	 * don't fail in this case
+	 */
+
+	if (result == -EBUSY)
+		return 0;
+	else if (result)
+		goto pci_fail;
+
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
 
 	return 0;
-
+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -731,8 +817,11 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 	if (ACPI_FAILURE(status))
 		printk(EEEPC_ERR "Error removing notify handler\n");
 
-	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
-	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+	if (ehotk->hotplug_slot) {
+		eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
+		eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+		pci_hp_deregister(ehotk->hotplug_slot);
+	}
 
 	kfree(ehotk);
 	return 0;


-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
@ 2009-02-24 16:00                     ` Matthew Garrett
  0 siblings, 0 replies; 50+ messages in thread
From: Matthew Garrett @ 2009-02-24 16:00 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary, Darren Salt

On Tue, Feb 24, 2009 at 03:29:36PM +0000, Darren Salt wrote:

> Not HOTPLUG_PCI_PCIE?

No - it just depends on the hotplug PCI core.

> With that selected (I see no point in testing this otherwise) *and*
> pciehp_force=1, I get -EBUSY when the hotplug slot registration is attempted
> and no wireless, bluetooth or hot key reporting; wireless & bluetooth are
> switched off at that point (I made sure that they were enabled via BIOS
> setup). Without that option, all is fine.

Right, so that sounds like everything works as expected. I guess to 
avoid breaking existing setups we should probably be a bit nicer there. 
Can you test whether this one works?

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index b3866ad..75a560b 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -307,6 +307,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 786ed86..e2412c9 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 
@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };
 
 /* The actual device the driver binds to */
@@ -194,6 +196,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };
 
+/* PCI hotplug ops */
+static int eeepc_get_adapter_status (struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;
 
@@ -519,6 +530,19 @@ static void notify_brn(void)
 		bd->props.brightness = read_brightness(bd);
 }
 
+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct pci_dev *dev;
@@ -620,6 +644,54 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }
 
+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+	
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+	ehotk->hotplug_slot = NULL;
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -700,11 +772,25 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}
 
+	result = eeepc_setup_pci_hotplug();
+
+	/*
+	 * If we get -EBUSY then something else is handling the PCI hotplug -
+	 * don't fail in this case
+	 */
+
+	if (result == -EBUSY)
+		return 0;
+	else if (result)
+		goto pci_fail;
+
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
 
 	return 0;
-
+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -731,8 +817,11 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 	if (ACPI_FAILURE(status))
 		printk(EEEPC_ERR "Error removing notify handler\n");
 
-	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
-	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+	if (ehotk->hotplug_slot) {
+		eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
+		eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+		pci_hp_deregister(ehotk->hotplug_slot);
+	}
 
 	kfree(ehotk);
 	return 0;


-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: Oopses and ACPI problems (Linus 2.6.29-rc4)
  2009-02-24 16:00                     ` Matthew Garrett
  (?)
@ 2009-02-24 19:45                     ` Darren Salt
  -1 siblings, 0 replies; 50+ messages in thread
From: Darren Salt @ 2009-02-24 19:45 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Ingo Molnar, linux-kernel, linux-acpi, Rafael J. Wysocki,
	Len Brown, Linus Torvalds, Andrew Morton, Jesse Barnes,
	Thomas Gleixner, H. Peter Anvin, Corentin Chary

I demand that Matthew Garrett may or may not have written...

> On Tue, Feb 24, 2009 at 03:29:36PM +0000, Darren Salt wrote:
>> Not HOTPLUG_PCI_PCIE?

> No - it just depends on the hotplug PCI core.

>> With that selected (I see no point in testing this otherwise) *and*
>> pciehp_force=1, I get -EBUSY when the hotplug slot registration is
>> attempted and no wireless, bluetooth or hot key reporting; wireless &
>> bluetooth are switched off at that point (I made sure that they were
>> enabled via BIOS setup). Without that option, all is fine.

> Right, so that sounds like everything works as expected. I guess to avoid
> breaking existing setups we should probably be a bit nicer there. Can you
> test whether this one works?

Works fine, AFAICS. If that's what's to be committed, then:
  Tested-By: Darren Salt <linux@youmustbejoking.demon.co.uk>

[snip]
-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Burn less waste. Use less packaging. Waste less.     USE FEWER RESOURCES.

Beware of quantum ducks. Quark! Quark!

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH] eee-laptop: Register as a pci-hotplug device
  2009-02-10 15:15           ` Darren Salt
  (?)
  (?)
@ 2009-04-19  1:56           ` Matthew Garrett
  2009-04-19  7:20             ` Corentin Chary
  -1 siblings, 1 reply; 50+ messages in thread
From: Matthew Garrett @ 2009-04-19  1:56 UTC (permalink / raw)
  To: linux-kernel, linux-acpi, Len Brown, Corentin Chary, Darren Salt

eee-laptop: Register as a pci-hotplug device

The eee contains a logically (but not physically) hotpluggable PCIe slot.
Currently this is handled by adding or removing the PCI device in response
to rfkill events, but if a user has forced pciehp to bind to it (with the
force=1 argument) then both drivers will try to handle the event and
hilarity (in the form of oopses) will ensue. This can be avoided by having
eee-laptop register the slot as a hotplug slot. Only one of pciehp and
eee-laptop will successfully register this, avoiding the problem.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Tested-by: Darren Salt <linux@youmustbejoking.demon.co.uk>

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 284ebac..afbe441 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -341,6 +341,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 6f54fd1..7039dc9 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 
@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };
 
 /* The actual device the driver binds to */
@@ -194,6 +196,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };
 
+/* PCI hotplug ops */
+static int eeepc_get_adapter_status(struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;
 
@@ -519,6 +530,19 @@ static void notify_brn(void)
 		bd->props.brightness = read_brightness(bd);
 }
 
+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct pci_dev *dev;
@@ -624,6 +648,54 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }
 
+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+	ehotk->hotplug_slot = NULL;
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -704,11 +776,25 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}
 
+	result = eeepc_setup_pci_hotplug();
+
+	/*
+	 * If we get -EBUSY then something else is handling the PCI hotplug -
+	 * don't fail in this case
+	 */
+
+	if (result == -EBUSY)
+		return 0;
+	else if (result)
+		goto pci_fail;
+
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
 
 	return 0;
-
+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -735,8 +821,11 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 	if (ACPI_FAILURE(status))
 		printk(EEEPC_ERR "Error removing notify handler\n");
 
-	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
-	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+	if (ehotk->hotplug_slot) {
+		eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
+		eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+		pci_hp_deregister(ehotk->hotplug_slot);
+	}
 
 	kfree(ehotk);
 	return 0;
-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH] eee-laptop: Register as a pci-hotplug device
  2009-04-19  1:56           ` [PATCH] eee-laptop: Register as a pci-hotplug device Matthew Garrett
@ 2009-04-19  7:20             ` Corentin Chary
  2009-04-19 15:13               ` Matthew Garrett
  0 siblings, 1 reply; 50+ messages in thread
From: Corentin Chary @ 2009-04-19  7:20 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, linux-acpi, Len Brown, Darren Salt

> +       result = eeepc_setup_pci_hotplug();
> +
> +       /*
> +        * If we get -EBUSY then something else is handling the PCI hotplug -
> +        * don't fail in this case
> +        */
> +
> +       if (result == -EBUSY)
> +               return 0;
> +       else if (result)
> +               goto pci_fail;
> +
>        eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
>        eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
>

> -       eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
> -       eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
> +       if (ehotk->hotplug_slot) {
> +               eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
> +               eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
> +               pci_hp_deregister(ehotk->hotplug_slot);
> +       }

Hi,
This patch conflict with
http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=8082f39bb3d4a27c7bb03a76e72c70c86d55117b;hp=7ec0a7290797f57b780f792d12f4bcc19c83aa4f
A quick fix is to do :

eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
if (ehotk->hotplug_slot)
      pci_hp_deregister(ehotk->hotplug_slot);

but I'm not sure it's correct.
I should have sent a series sooner to avoid that :/
Thanks

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] eee-laptop: Register as a pci-hotplug device
  2009-04-19  7:20             ` Corentin Chary
@ 2009-04-19 15:13               ` Matthew Garrett
  2009-04-25 14:12                 ` Corentin Chary
  0 siblings, 1 reply; 50+ messages in thread
From: Matthew Garrett @ 2009-04-19 15:13 UTC (permalink / raw)
  To: Corentin Chary; +Cc: linux-kernel, linux-acpi, Len Brown, Darren Salt

On Sun, Apr 19, 2009 at 09:20:07AM +0200, Corentin Chary wrote:

> Hi,
> This patch conflict with
> http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=8082f39bb3d4a27c7bb03a76e72c70c86d55117b;hp=7ec0a7290797f57b780f792d12f4bcc19c83aa4f
> A quick fix is to do :
> 
> eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
> eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
> if (ehotk->hotplug_slot)
>       pci_hp_deregister(ehotk->hotplug_slot);
> 
> but I'm not sure it's correct.
> I should have sent a series sooner to avoid that :/

Ok - I'll grab that and rediff.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH] eee-laptop: Register as a pci-hotplug device
  2009-04-19 15:13               ` Matthew Garrett
@ 2009-04-25 14:12                 ` Corentin Chary
  2009-04-26 17:16                   ` Matthew Garrett
  0 siblings, 1 reply; 50+ messages in thread
From: Corentin Chary @ 2009-04-25 14:12 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, linux-acpi, Len Brown, Darren Salt

Hi,
I take your patch and make it works against acpi4asus tree.
If you think it's ok, then I'll send a serie including this patch to Len.
(the tree is at http://git.iksaif.net/ )

From: Matthew Garrett <mjg@redhat.com>

The eee contains a logically (but not physically) hotpluggable PCIe slot.
Currently this is handled by adding or removing the PCI device in response
to rfkill events, but if a user has forced pciehp to bind to it (with the
force=1 argument) then both drivers will try to handle the event and
hilarity (in the form of oopses) will ensue. This can be avoided by having
eee-laptop register the slot as a hotplug slot. Only one of pciehp and
eee-laptop will successfully register this, avoiding the problem.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Tested-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
---
 drivers/platform/x86/Kconfig        |    1 +
 drivers/platform/x86/eeepc-laptop.c |   87 +++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 284ebac..afbe441 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -341,6 +341,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c
b/drivers/platform/x86/eeepc-laptop.c
index 7aaf587..4440f6c 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>

 #define EEEPC_LAPTOP_VERSION	"0.1"

@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };

 /* The actual device the driver binds to */
@@ -197,6 +199,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };

+/* PCI hotplug ops */
+static int eeepc_get_adapter_status(struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;

@@ -529,6 +540,19 @@ static int notify_brn(void)
 	return -1;
 }

+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	enum rfkill_state state;
@@ -655,6 +679,54 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }

+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+	ehotk->hotplug_slot = NULL;
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -738,8 +810,21 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}

+	result = eeepc_setup_pci_hotplug();
+	/*
+	 * If we get -EBUSY then something else is handling the PCI hotplug -
+	 * don't fail in this case
+	 */
+	if (result == -EBUSY)
+		return 0;
+	else if (result)
+		goto pci_fail;
+
 	return 0;

+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -768,6 +853,8 @@ static int eeepc_hotk_remove(struct acpi_device
*device, int type)

 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+	if (ehotk->hotplug_slot)
+		pci_hp_deregister(ehotk->hotplug_slot);

 	kfree(ehotk);
 	return 0;
-- 
1.6.2.3

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH] eee-laptop: Register as a pci-hotplug device
  2009-04-25 14:12                 ` Corentin Chary
@ 2009-04-26 17:16                   ` Matthew Garrett
  2009-04-26 20:51                     ` Corentin Chary
  0 siblings, 1 reply; 50+ messages in thread
From: Matthew Garrett @ 2009-04-26 17:16 UTC (permalink / raw)
  To: Corentin Chary; +Cc: linux-kernel, linux-acpi, Len Brown, Darren Salt

Hm. I /think/ that version leaks notification handlers on the failure 
path. Does this look ok? I don't have an eee to hand right now, so can't 
test this at the moment.

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 284ebac..afbe441 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -341,6 +341,7 @@ config EEEPC_LAPTOP
 	select BACKLIGHT_CLASS_DEVICE
 	select HWMON
 	select RFKILL
+	select HOTPLUG_PCI
 	---help---
 	  This driver supports the Fn-Fx keys on Eee PC laptops.
 	  It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 7aaf587..deaf3c3 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -31,6 +31,7 @@
 #include <linux/input.h>
 #include <linux/rfkill.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 
@@ -132,6 +133,7 @@ struct eeepc_hotk {
 	u16 *keycode_map;
 	struct rfkill *eeepc_wlan_rfkill;
 	struct rfkill *eeepc_bluetooth_rfkill;
+	struct hotplug_slot *hotplug_slot;
 };
 
 /* The actual device the driver binds to */
@@ -197,6 +199,15 @@ static struct acpi_driver eeepc_hotk_driver = {
 	},
 };
 
+/* PCI hotplug ops */
+static int eeepc_get_adapter_status(struct hotplug_slot *slot, u8 *value);
+
+static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.get_adapter_status = eeepc_get_adapter_status,
+	.get_power_status = eeepc_get_adapter_status,
+};
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;
 
@@ -529,6 +540,19 @@ static int notify_brn(void)
 	return -1;
 }
 
+static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
+				    u8 *value)
+{
+	int val = get_acpi(CM_ASL_WLAN);
+
+	if (val == 1 || val == 0)
+		*value = val;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 {
 	enum rfkill_state state;
@@ -655,6 +679,54 @@ static void eeepc_unregister_rfkill_notifier(char *node)
 	}
 }
 
+static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
+{
+	kfree(hotplug_slot->info);
+	kfree(hotplug_slot);
+}
+
+static int eeepc_setup_pci_hotplug(void)
+{
+	int ret = -ENOMEM;
+	struct pci_bus *bus = pci_find_bus(0, 1);
+
+	if (!bus) {
+		printk(EEEPC_ERR "Unable to find wifi PCI bus\n");
+		return -ENODEV;
+	}
+
+	ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!ehotk->hotplug_slot)
+		goto error_slot;
+
+	ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
+					    GFP_KERNEL);
+	if (!ehotk->hotplug_slot->info)
+		goto error_info;
+
+	ehotk->hotplug_slot->private = ehotk;
+	ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
+	ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
+	eeepc_get_adapter_status(ehotk->hotplug_slot,
+				 &ehotk->hotplug_slot->info->adapter_status);
+
+	ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
+	if (ret) {
+		printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret);
+		goto error_register;
+	}
+
+	return 0;
+
+error_register:
+	kfree(ehotk->hotplug_slot->info);
+error_info:
+	kfree(ehotk->hotplug_slot);
+	ehotk->hotplug_slot = NULL;
+error_slot:
+	return ret;
+}
+
 static int eeepc_hotk_add(struct acpi_device *device)
 {
 	acpi_status status = AE_OK;
@@ -738,8 +810,21 @@ static int eeepc_hotk_add(struct acpi_device *device)
 			goto bluetooth_fail;
 	}
 
+	result = eeepc_setup_pci_hotplug();
+	/*
+	 * If we get -EBUSY then something else is handling the PCI hotplug -
+	 * don't fail in this case
+	 */
+	if (result == -EBUSY)
+		return 0;
+	else if (result)
+		goto pci_fail;
+
 	return 0;
 
+ pci_fail:
+	if (ehotk->eeepc_bluetooth_rfkill)
+		rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
  bluetooth_fail:
 	if (ehotk->eeepc_bluetooth_rfkill)
 		rfkill_free(ehotk->eeepc_bluetooth_rfkill);
@@ -748,6 +833,10 @@ static int eeepc_hotk_add(struct acpi_device *device)
  wlan_fail:
 	if (ehotk->eeepc_wlan_rfkill)
 		rfkill_free(ehotk->eeepc_wlan_rfkill);
+	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
+	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+	acpi_remove_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
+				   eeepc_hotk_notify);
  ehotk_fail:
 	kfree(ehotk);
 	ehotk = NULL;
@@ -768,6 +857,8 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
+	if (ehotk->hotplug_slot)
+		pci_hp_deregister(ehotk->hotplug_slot);
 
 	kfree(ehotk);
 	return 0;

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH] eee-laptop: Register as a pci-hotplug device
  2009-04-26 17:16                   ` Matthew Garrett
@ 2009-04-26 20:51                     ` Corentin Chary
  0 siblings, 0 replies; 50+ messages in thread
From: Corentin Chary @ 2009-04-26 20:51 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, linux-acpi, Len Brown, Darren Salt

On Sun, Apr 26, 2009 at 7:16 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> Hm. I /think/ that version leaks notification handlers on the failure
> path. Does this look ok? I don't have an eee to hand right now, so can't
> test this at the moment.
I'll test it tomorow, but it seems ok.
Thanks

-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2009-04-26 20:51 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-08 21:01 Linus 2.6.29-rc4 Linus Torvalds
2009-02-09  1:21 ` Arjan van de Ven
2009-02-09  8:28   ` Ingo Molnar
2009-02-09 12:18     ` Avi Kivity
2009-02-09 13:34 ` Gerd Hoffmann
2009-02-09 15:04   ` Steven Noonan
2009-02-09 18:26 ` Oopses and ACPI problems (Linus 2.6.29-rc4) Darren Salt
2009-02-09 23:49   ` Ingo Molnar
2009-02-09 23:49     ` Ingo Molnar
2009-02-10 14:12     ` Darren Salt
2009-02-10 14:12       ` Darren Salt
2009-02-10 14:54       ` [PATCH 2.6.29-rc4] Restore ACPI reporting via /proc/acpi/events for EeePC & other Asus laptops Darren Salt
2009-02-10 14:54         ` Darren Salt
2009-02-24 11:31         ` Corentin Chary
2009-02-10 15:04       ` Oopses and ACPI problems (Linus 2.6.29-rc4) Matthew Garrett
2009-02-10 15:04         ` Matthew Garrett
2009-02-10 15:15         ` Darren Salt
2009-02-10 15:15           ` Darren Salt
2009-02-10 15:45           ` Matthew Garrett
2009-02-10 15:45             ` Matthew Garrett
2009-02-10 16:03             ` Darren Salt
2009-02-23 16:39               ` Matthew Garrett
2009-02-23 16:39                 ` Matthew Garrett
2009-02-24 15:29                 ` Darren Salt
2009-02-24 16:00                   ` Matthew Garrett
2009-02-24 16:00                     ` Matthew Garrett
2009-02-24 19:45                     ` Darren Salt
2009-02-10 16:06             ` Corentin Chary
2009-02-10 19:16               ` Darren Salt
2009-02-11  2:03                 ` Matthew Garrett
2009-02-11  2:03                   ` Matthew Garrett
2009-02-11  1:23               ` yakui_zhao
2009-04-19  1:56           ` [PATCH] eee-laptop: Register as a pci-hotplug device Matthew Garrett
2009-04-19  7:20             ` Corentin Chary
2009-04-19 15:13               ` Matthew Garrett
2009-04-25 14:12                 ` Corentin Chary
2009-04-26 17:16                   ` Matthew Garrett
2009-04-26 20:51                     ` Corentin Chary
2009-02-10  1:06   ` Oopses and ACPI problems (Linus 2.6.29-rc4) yakui_zhao
2009-02-10  1:06     ` yakui_zhao
2009-02-10 14:02 ` [PATCH] Do not account for the address space used by hugetlbfs using VM_ACCOUNT V2 (Was Linus 2.6.29-rc4) Mel Gorman
2009-02-10 23:45   ` Andrew Morton
2009-02-11 11:15     ` Mel Gorman
2009-02-11  9:43   ` Andy Whitcroft
2009-02-11 10:30     ` Mel Gorman
2009-02-11 12:03       ` Andy Whitcroft
2009-02-11 14:20         ` Mel Gorman
2009-02-11 16:03           ` Andy Whitcroft
2009-02-11 16:34             ` Mel Gorman
2009-02-11 16:43               ` Andy Whitcroft

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.