1. 13 2月, 2008 2 次提交
  2. 12 2月, 2008 2 次提交
    • K
      mempolicy: silently restrict nodemask to allowed nodes · 31f1de46
      KOSAKI Motohiro 提交于
      Kosaki Motohito noted that "numactl --interleave=all ..." failed in the
      presence of memoryless nodes.  This patch attempts to fix that problem.
      
      Some background:
      
      numactl --interleave=all calls set_mempolicy(2) with a fully populated
      [out to MAXNUMNODES] nodemask.  set_mempolicy() [in do_set_mempolicy()]
      calls contextualize_policy() which requires that the nodemask be a
      subset of the current task's mems_allowed; else EINVAL will be returned.
      
      A task's mems_allowed will always be a subset of node_states[N_HIGH_MEMORY]
      i.e., nodes with memory.  So, a fully populated nodemask will be
      declared invalid if it includes memoryless nodes.
      
        NOTE:  the same thing will occur when running in a cpuset
               with restricted mem_allowed--for the same reason:
               node mask contains dis-allowed nodes.
      
      mbind(2), on the other hand, just masks off any nodes in the nodemask
      that are not included in the caller's mems_allowed.
      
      In each case [mbind() and set_mempolicy()], mpol_check_policy() will
      complain [again, resulting in EINVAL] if the nodemask contains any
      memoryless nodes.  This is somewhat redundant as mpol_new() will remove
      memoryless nodes for interleave policy, as will bind_zonelist()--called
      by mpol_new() for BIND policy.
      
      Proposed fix:
      
      1) modify contextualize_policy logic to:
         a) remember whether the incoming node mask is empty.
         b) if not, restrict the nodemask to allowed nodes, as is
            currently done in-line for mbind().  This guarantees
            that the resulting mask includes only nodes with memory.
      
            NOTE:  this is a [benign, IMO] change in behavior for
                   set_mempolicy().  Dis-allowed nodes will be
                   silently ignored, rather than returning an error.
      
         c) fold this code into mpol_check_policy(), replace 2 calls to
            contextualize_policy() to call mpol_check_policy() directly
            and remove contextualize_policy().
      
      2) In existing mpol_check_policy() logic, after "contextualization":
         a) MPOL_DEFAULT:  require that in coming mask "was_empty"
         b) MPOL_{BIND|INTERLEAVE}:  require that contextualized nodemask
            contains at least one node.
         c) add a case for MPOL_PREFERRED:  if in coming was not empty
            and resulting mask IS empty, user specified invalid nodes.
            Return EINVAL.
         c) remove the now redundant check for memoryless nodes
      
      3) remove the now redundant masking of policy nodes for interleave
         policy from mpol_new().
      
      4) Now that mpol_check_policy() contextualizes the nodemask, remove
         the in-line nodes_and() from sys_mbind().  I believe that this
         restores mbind() to the behavior before the memoryless-nodes
         patch series.  E.g., we'll no longer treat an invalid nodemask
         with MPOL_PREFERRED as local allocation.
      
      [ Patch history:
      
        v1 -> v2:
         - Communicate whether or not incoming node mask was empty to
           mpol_check_policy() for better error checking.
         - As suggested by David Rientjes, remove the now unused
           cpuset_nodes_subset_current_mems_allowed() from cpuset.h
      
        v2 -> v3:
         - As suggested by Kosaki Motohito, fold the "contextualization"
           of policy nodemask into mpol_check_policy().  Looks a little
           cleaner. ]
      Signed-off-by: NLee Schermerhorn <lee.schermerhorn@hp.com>
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Tested-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31f1de46
    • A
      Prevent IDE boot ops on NUMA system · 1f07e988
      Andi Kleen 提交于
      Without this patch a Opteron test system here oopses at boot with
      current git.
      
      Calling to_pci_dev() on a NULL pointer gives a negative value so the
      following NULL pointer check never triggers and then an illegal address
      is referenced.  Check the unadjusted original device pointer for NULL
      instead.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1f07e988
  3. 11 2月, 2008 4 次提交
    • B
      ide-disk: fix flush requests (take 2) · 395d8ef5
      Bartlomiej Zolnierkiewicz 提交于
      commit 813a0eb2
      Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Date:   Fri Jan 25 22:17:10 2008 +0100
      
          ide: switch idedisk_prepare_flush() to use REQ_TYPE_ATA_TASKFILE requests
      
      ...
      
      broke flush requests.
      
      Allocating IDE command structure on the stack for flush requests is not
      a very brilliant idea:
      
      - idedisk_prepare_flush() only prepares the request and it doesn't wait
        for it to be completed
      
      - there are can be multiple flush requests queued in the queue
      
      Fix the problem (per hints from James Bottomley) by:
      - dynamically allocating ide_task_t instance using kmalloc(..., GFP_ATOMIC)
      - adding new taskfile flag (IDE_TFLAG_DYN)
      - calling kfree() in ide_end_drive_command() if IDE_TFLAG_DYN is set
        (while at it rename 'args' to 'task' and fix whitespace damage)
      
      [ This will be fixed properly before 2.6.25 but this bug is rather
        critical and the proper solution requires some more work + testing. ]
      
      Thanks to Sebastian Siewior and Christoph Hellwig for reporting the
      problem and testing patches (extra thanks to Sebastian for bisecting
      it to the guilty commmit).
      Tested-by: NSebastian Siewior <ide-bug@ml.breakpoint.cc>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      395d8ef5
    • S
      ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option · 8e882ba1
      Sergei Shtylyov 提交于
      Introduce new option CONFIG_BLK_DEV_IDEDMA_SFF for non-PCI SFF-8038i compatible
      bus mastering IDE controllers (which there are a few known), thus fixing a hack
      made for Palmchip BK3710 controller...
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Anton Salnikov <asalnikov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      8e882ba1
    • J
      nfsd: clean up svc_reserve_auth() · fbb7878c
      J. Bruce Fields 提交于
      This is a void function attempting to return the return value from
      another void function, which seems harmless but extremely weird, and
      apparently makes some compilers complain.
      
      While we're there, clean up a little (e.g. the switch statement had a
      minor style problem and seemed overkill as long as there's only one
      case).
      
      Thanks to Trond for noticing this.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      fbb7878c
    • M
      Change pci_raw_ops to pci_raw_read/write · b6ce068a
      Matthew Wilcox 提交于
      We want to allow different implementations of pci_raw_ops for standard
      and extended config space on x86.  Rather than clutter generic code with
      knowledge of this, we make pci_raw_ops private to x86 and use it to
      implement the new raw interface -- raw_pci_read() and raw_pci_write().
      Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b6ce068a
  4. 10 2月, 2008 7 次提交
  5. 09 2月, 2008 25 次提交