1. 24 Apr, 2007 7 commits
    • Balbir Singh's avatar
      Taskstats fix the structure members alignment issue · 7e40f2ab
      Balbir Singh authored
      We broke the the alignment of members of taskstats to the 8 byte boundary
      with the CSA patches.  In the current kernel, the taskstats structure is
      not suitable for use by 32 bit applications in a 64 bit kernel.
      
      On x86_64
      
      Offsets of taskstats' members (64 bit kernel, 64 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              16,     # cpu_count
              24,     # cpu_delay_total
              32,     # blkio_count
              40,     # blkio_delay_total
              48,     # swapin_count
              56,     # swapin_delay_total
              64,     # cpu_run_real_total
              72,     # cpu_run_virtual_total
              80,     # ac_comm
              112,    # ac_sched
              113,    # ac_pad
              116,    # ac_uid
              120,    # ac_gid
              124,    # ac_pid
              128,    # ac_ppid
              132,    # ac_btime
              136,    # ac_etime
              144,    # ac_utime
              152,    # ac_stime
              160,    # ac_minflt
              168,    # ac_majflt
              176,    # coremem
              184,    # virtmem
              192,    # hiwater_rss
              200,    # hiwater_vm
              208,    # read_char
              216,    # write_char
              224,    # read_syscalls
              232,    # write_syscalls
              240,    # read_bytes
              248,    # write_bytes
              256,    # cancelled_write_bytes
          );
      
      Offsets of taskstats' members (64 bit kernel, 32 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              12,     # cpu_count
              20,     # cpu_delay_total
              28,     # blkio_count
              36,     # blkio_delay_total
              44,     # swapin_count
              52,     # swapin_delay_total
              60,     # cpu_run_real_total
              68,     # cpu_run_virtual_total
              76,     # ac_comm
              108,    # ac_sched
              109,    # ac_pad
              112,    # ac_uid
              116,    # ac_gid
              120,    # ac_pid
              124,    # ac_ppid
              128,    # ac_btime
              132,    # ac_etime
              140,    # ac_utime
              148,    # ac_stime
              156,    # ac_minflt
              164,    # ac_majflt
              172,    # coremem
              180,    # virtmem
              188,    # hiwater_rss
              196,    # hiwater_vm
              204,    # read_char
              212,    # write_char
              220,    # read_syscalls
              228,    # write_syscalls
              236,    # read_bytes
              244,    # write_bytes
              252,    # cancelled_write_bytes
          );
      
      This is one way to solve the problem without re-arranging structure members
      is to pack the structure.  The patch adds an __attribute__((aligned(8))) to
      the taskstats structure members so that 32 bit applications using taskstats
      can work with a 64 bit kernel.
      
      Using __attribute__((packed)) would break the 64 bit alignment of members.
      
      The fix was tested on x86_64. After the fix, we got
      
      Offsets of taskstats' members (64 bit kernel, 64 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              16,     # cpu_count
              24,     # cpu_delay_total
              32,     # blkio_count
              40,     # blkio_delay_total
              48,     # swapin_count
              56,     # swapin_delay_total
              64,     # cpu_run_real_total
              72,     # cpu_run_virtual_total
              80,     # ac_comm
              112,    # ac_sched
              113,    # ac_pad
              120,    # ac_uid
              124,    # ac_gid
              128,    # ac_pid
              132,    # ac_ppid
              136,    # ac_btime
              144,    # ac_etime
              152,    # ac_utime
              160,    # ac_stime
              168,    # ac_minflt
              176,    # ac_majflt
              184,    # coremem
              192,    # virtmem
              200,    # hiwater_rss
              208,    # hiwater_vm
              216,    # read_char
              224,    # write_char
              232,    # read_syscalls
              240,    # write_syscalls
              248,    # read_bytes
              256,    # write_bytes
              264,    # cancelled_write_bytes
          );
      
      Offsets of taskstats' members (64 bit kernel, 32 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              16,     # cpu_count
              24,     # cpu_delay_total
              32,     # blkio_count
              40,     # blkio_delay_total
              48,     # swapin_count
              56,     # swapin_delay_total
              64,     # cpu_run_real_total
              72,     # cpu_run_virtual_total
              80,     # ac_comm
              112,    # ac_sched
              113,    # ac_pad
              120,    # ac_uid
              124,    # ac_gid
              128,    # ac_pid
              132,    # ac_ppid
              136,    # ac_btime
              144,    # ac_etime
              152,    # ac_utime
              160,    # ac_stime
              168,    # ac_minflt
              176,    # ac_majflt
              184,    # coremem
              192,    # virtmem
              200,    # hiwater_rss
              208,    # hiwater_vm
              216,    # read_char
              224,    # write_char
              232,    # read_syscalls
              240,    # write_syscalls
              248,    # read_bytes
              256,    # write_bytes
              264,    # cancelled_write_bytes
          );
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: Jay Lan <jlan@engr.sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7e40f2ab
    • Jiri Slaby's avatar
      Char: mxser, fix TIOCMIWAIT · fc83815c
      Jiri Slaby authored
      There was schedule() missing in the TIOCMIWAIT ioctl. Solve it by moving
      the code to the wait_event_interruptible.
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Cc: Jan Yenya Kasprzak <kas@fi.muni.cz>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fc83815c
    • Jiri Slaby's avatar
      Char: mxser_new, fix TIOCMIWAIT · b446a4a5
      Jiri Slaby authored
      There was schedule() missing in the TIOCMIWAIT ioctl.  Solve it by moving
      the code to the wait_event_interruptible.
      
      Cc: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b446a4a5
    • Jan Yenya Kasprzak's avatar
    • Hugh Dickins's avatar
      fix OOM killing processes wrongly thought MPOL_BIND · 3d124cbb
      Hugh Dickins authored
      I only have CONFIG_NUMA=y for build testing: surprised when trying a memhog
      to see lots of other processes killed with "No available memory
      (MPOL_BIND)".  memhog is killed correctly once we initialize nodemask in
      constrained_alloc().
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Acked-by: default avatarChristoph Lameter <clameter@sgi.com>
      Acked-by: default avatarWilliam Irwin <bill.irwin@oracle.com>
      Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3d124cbb
    • Taku Izumi's avatar
      Fix possible NULL pointer access in 8250 serial driver · fdc30b3d
      Taku Izumi authored
      I encountered the following kernel panic.  The cause of this problem was
      NULL pointer access in check_modem_status() in 8250.c.  I confirmed this
      problem is fixed by the attached patch, but I don't know this is the
      correct fix.
      
      sadc[4378]: NaT consumption 2216203124768 [1]
      Modules linked in: binfmt_misc dm_mirror dm_mod thermal processor fan
      container button sg e100 eepro100 mii ehci_hcd ohci_hcd
      
          Pid: 4378, CPU 0, comm: sadc
          psr : 00001210085a2010 ifs : 8000000000000289 ip : [<a000000100482071>]
          Not tainted
          ip is at check_modem_status+0xf1/0x360
      
          Call Trace:
          [<a000000100013940>] show_stack+0x40/0xa0
          [<a0000001000145a0>] show_regs+0x840/0x880
          [<a0000001000368e0>] die+0x1c0/0x2c0
          [<a000000100036a30>] die_if_kernel+0x50/0x80
          [<a000000100037c40>] ia64_fault+0x11e0/0x1300
          [<a00000010000bdc0>] ia64_leave_kernel+0x0/0x280
          [<a000000100482070>] check_modem_status+0xf0/0x360
          [<a000000100482300>] serial8250_get_mctrl+0x20/0xa0
          [<a000000100478170>] uart_read_proc+0x250/0x860
          [<a0000001001c16d0>] proc_file_read+0x1d0/0x4c0
          [<a0000001001394b0>] vfs_read+0x1b0/0x300
          [<a000000100139cd0>] sys_read+0x70/0xe0
          [<a00000010000bc20>] ia64_ret_from_syscall+0x0/0x20
          [<a000000000010620>] __kernel_syscall_via_break+0x0/0x20
      
      Fix the possible NULL pointer access in check_modem_status() in 8250.c.  The
      check_modem_status() would access 'info' member of uart_port structure, but it
      is not initialized before uart_open() is called.  The check_modem_status() can
      be called through /proc/tty/driver/serial before uart_open() is called.
      Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarTaku Izumi <izumi2005@soft.fujitsu.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fdc30b3d
    • David Rientjes's avatar
      oom: kill all threads that share mm with killed task · 650a7c97
      David Rientjes authored
      oom_kill_task() calls __oom_kill_task() to OOM kill a selected task.
      When finding other threads that share an mm with that task, we need to
      kill those individual threads and not the same one.
      
      (Bug introduced by f2a2a710)
      Acked-by: default avatarWilliam Irwin <bill.irwin@oracle.com>
      Acked-by: default avatarChristoph Lameter <clameter@engr.sgi.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      650a7c97
  2. 23 Apr, 2007 3 commits
  3. 21 Apr, 2007 13 commits
  4. 20 Apr, 2007 10 commits
  5. 19 Apr, 2007 7 commits