1. 30 5月, 2011 11 次提交
  2. 29 5月, 2011 29 次提交
    • M
      dm kcopyd: return client directly and not through a pointer · fa34ce73
      Mikulas Patocka 提交于
      Return client directly from dm_kcopyd_client_create, not through a
      parameter, making it consistent with dm_io_client_create.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      fa34ce73
    • M
      dm kcopyd: reserve fewer pages · 5f43ba29
      Mikulas Patocka 提交于
      Reserve just the minimum of pages needed to process one job.
      
      Because we allocate pages from page allocator, we don't need to reserve
      a large number of pages.  The maximum job size is SUB_JOB_SIZE and we
      calculate the number of reserved pages based on this.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      5f43ba29
    • M
      dm io: use fixed initial mempool size · bda8efec
      Mikulas Patocka 提交于
      Replace the arbitrary calculation of an initial io struct mempool size
      with a constant.
      
      The code calculated the number of reserved structures based on the request
      size and used a "magic" multiplication constant of 4.  This patch changes
      it to reserve a fixed number - itself still chosen quite arbitrarily.
      Further testing might show if there is a better number to choose.
      
      Note that if there is no memory pressure, we can still allocate an
      arbitrary number of "struct io" structures.  One structure is enough to
      process the whole request.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      bda8efec
    • M
      dm kcopyd: alloc pages from the main page allocator · d0471458
      Mikulas Patocka 提交于
      This patch changes dm-kcopyd so that it allocates pages from the main
      page allocator with __GFP_NOWARN | __GFP_NORETRY flags (so that it can
      fail in case of memory pressure). If the allocation fails, dm-kcopyd
      allocates pages from its own reserve.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      d0471458
    • M
      dm kcopyd: add gfp parm to alloc_pl · f99b55ee
      Mikulas Patocka 提交于
      Introduce a parameter for gfp flags to alloc_pl() for use in following
      patches.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      f99b55ee
    • M
      dm kcopyd: remove superfluous page allocation spinlock · 4cc1b4cf
      Mikulas Patocka 提交于
      Remove the spinlock protecting the pages allocation.  The spinlock is only
      taken on initialization or from single-threaded workqueue.  Therefore, the
      spinlock is useless.
      
      The spinlock is taken in kcopyd_get_pages and kcopyd_put_pages.
      
      kcopyd_get_pages is only called from run_pages_job, which is only
      called from process_jobs called from do_work.
      
      kcopyd_put_pages is called from client_alloc_pages (which is initialization
      function) or from run_complete_job. run_complete_job is only called from
      process_jobs called from do_work.
      
      Another spinlock, kc->job_lock is taken each time someone pushes or pops
      some work for the worker thread.  Once we take kc->job_lock, we
      guarantee that any written memory is visible to the other CPUs.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      4cc1b4cf
    • M
      dm kcopyd: preallocate sub jobs to avoid deadlock · c6ea41fb
      Mikulas Patocka 提交于
      There's a possible theoretical deadlock in dm-kcopyd because multiple
      allocations from the same mempool are required to finish a request.
      Avoid this by preallocating sub jobs.
      
      There is a mempool of 512 entries. Each request requires up to 9
      entries from the mempool. If we have at least 57 concurrent requests
      running, the mempool may overflow and mempool allocations may start
      blocking until another entry is freed to the mempool. Because the same
      thread is used to free entries to the mempool and allocate entries from
      the mempool, this may result in a deadlock.
      
      This patch changes it so that one mempool entry contains all 9 "struct
      kcopyd_job" required to fulfill the whole request. The allocation is
      done only once in dm_kcopyd_copy and no further mempool allocations are
      done during request processing.
      
      If dm_kcopyd_copy is not run in the completion thread, this
      implementation is deadlock-free.
      
      MIN_JOBS needs reducing accordingly and we've chosen to reduce it
      further to 8.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      c6ea41fb
    • M
      dm kcopyd: avoid pointless job splitting · a705a34a
      Mikulas Patocka 提交于
      Don't split SUB_JOB_SIZE jobs
      
      If the job size equals SUB_JOB_SIZE, there is no point in splitting it.
      Splitting it just unnecessarily wastes time, because the split job size
      is SUB_JOB_SIZE too.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      a705a34a
    • M
      dm mpath: do not fail paths after integrity errors · 6f13f6fb
      Martin K. Petersen 提交于
      Integrity errors need to be passed to the owner of the integrity
      metadata for processing. Consequently EILSEQ should be passed up the
      stack.
      
      Cc: stable@kernel.org
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Acked-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      6f13f6fb
    • M
      dm table: reject devices without request fns · f4808ca9
      Milan Broz 提交于
      This patch adds a check that a block device has a request function
      defined before it is used.  Otherwise, misconfiguration can cause an oops.
      
      Because we are allowing devices with zero size e.g. an offline multipath
      device as in commit 2cd54d9b
      ("dm: allow offline devices") there needs to be an additional check
      to ensure devices are initialised.  Some block devices, like a loop
      device without a backing file, exist but have no request function.
      
      Reproducer is trivial: dm-mirror on unbound loop device
      (no backing file on loop devices)
      
      dmsetup create x --table "0 8 mirror core 2 8 sync 2 /dev/loop0 0 /dev/loop1 0"
      
      and mirror resync will immediatelly cause OOps.
      
      BUG: unable to handle kernel NULL pointer dereference at   (null)
       ? generic_make_request+0x2bd/0x590
       ? kmem_cache_alloc+0xad/0x190
       submit_bio+0x53/0xe0
       ? bio_add_page+0x3b/0x50
       dispatch_io+0x1ca/0x210 [dm_mod]
       ? read_callback+0x0/0xd0 [dm_mirror]
       dm_io+0xbb/0x290 [dm_mod]
       do_mirror+0x1e0/0x748 [dm_mirror]
      Signed-off-by: NMilan Broz <mbroz@redhat.com>
      Reported-by: NZdenek Kabelac <zkabelac@redhat.com>
      Acked-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      f4808ca9
    • M
      dm table: allow targets to support discards internally · 4c259327
      Mike Snitzer 提交于
      Permit a target to support discards regardless of whether or not all its
      underlying devices do.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      4c259327
    • H
      [S390] mm: fix mmu_gather rework · 3c5cffb6
      Heiko Carstens 提交于
      Quite a few functions that get called from the tlb gather code require that
      preemption must be disabled. So disable preemption inside of the called
      functions instead.
      The only drawback is that rcu_table_freelist_finish() doesn't get necessarily
      called on the cpu(s) that filled the free lists. So we may see a delay, until
      we finally see an rcu callback. However over time this shouldn't matter.
      
      So we get rid of lots of "BUG: using smp_processor_id() in preemptible"
      messages.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      3c5cffb6
    • H
      [S390] mm: fix storage key handling · a43a9d93
      Heiko Carstens 提交于
      page_get_storage_key() and page_set_storage_key() expect a page address
      and not its page frame number. This got inconsistent with 2d42552d
      "[S390] merge page_test_dirty and page_clear_dirty".
      
      Result is that we read/write storage keys from random pages and do not
      have a working dirty bit tracking at all.
      E.g. SetPageUpdate() doesn't clear the dirty bit of requested pages, which
      for example ext4 doesn't like very much and panics after a while.
      
      Unable to handle kernel paging request at virtual user address (null)
      Oops: 0004 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      Modules linked in:
      CPU: 1 Not tainted 2.6.39-07551-g139f37f5-dirty #152
      Process flush-94:0 (pid: 1576, task: 000000003eb34538, ksp: 000000003c287b70)
      Krnl PSW : 0704c00180000000 0000000000316b12 (jbd2_journal_file_inode+0x10e/0x138)
                 R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
      Krnl GPRS: 0000000000000000 0000000000000000 0000000000000000 0700000000000000
                 0000000000316a62 000000003eb34cd0 0000000000000025 000000003c287b88
                 0000000000000001 000000003c287a70 000000003f1ec678 000000003f1ec000
                 0000000000000000 000000003e66ec00 0000000000316a62 000000003c287988
      Krnl Code: 0000000000316b04: f0a0000407f4       srp     4(11,%r0),2036,0
                 0000000000316b0a: b9020022           ltgr    %r2,%r2
                 0000000000316b0e: a7740015           brc     7,316b38
                >0000000000316b12: e3d0c0000024       stg     %r13,0(%r12)
                 0000000000316b18: 4120c010           la      %r2,16(%r12)
                 0000000000316b1c: 4130d060           la      %r3,96(%r13)
                 0000000000316b20: e340d0600004       lg      %r4,96(%r13)
                 0000000000316b26: c0e50002b567       brasl   %r14,36d5f4
      Call Trace:
      ([<0000000000316a62>] jbd2_journal_file_inode+0x5e/0x138)
       [<00000000002da13c>] mpage_da_map_and_submit+0x2e8/0x42c
       [<00000000002daac2>] ext4_da_writepages+0x2da/0x504
       [<00000000002597e8>] writeback_single_inode+0xf8/0x268
       [<0000000000259f06>] writeback_sb_inodes+0xd2/0x18c
       [<000000000025a700>] writeback_inodes_wb+0x80/0x168
       [<000000000025aa92>] wb_writeback+0x2aa/0x324
       [<000000000025abde>] wb_do_writeback+0xd2/0x274
       [<000000000025ae3a>] bdi_writeback_thread+0xba/0x1c4
       [<00000000001737be>] kthread+0xa6/0xb0
       [<000000000056c1da>] kernel_thread_starter+0x6/0xc
       [<000000000056c1d4>] kernel_thread_starter+0x0/0xc
      INFO: lockdep is turned off.
      Last Breaking-Event-Address:
       [<0000000000316a8a>] jbd2_journal_file_inode+0x86/0x138
      Reported-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      a43a9d93
    • P
      Squashfs: Fix sanity check patches on big-endian systems · d5b72ce1
      Phillip Lougher 提交于
      le64 values should be swapped when accessing on
      big-endian systems.
      Signed-off-by: NPhillip Lougher <phillip@lougher.demon.co.uk>
      d5b72ce1
    • L
      Merge branch 'ec-cleanup' into release · 751516f0
      Len Brown 提交于
      Conflicts:
      	drivers/platform/x86/compal-laptop.c
      751516f0
    • L
      Merge branches 'acpica', 'aml-custom', 'bugzilla-16548', 'bugzilla-20242',... · 6288cf1e
      Len Brown 提交于
      Merge branches 'acpica', 'aml-custom', 'bugzilla-16548', 'bugzilla-20242', 'd3-cold', 'ec-asus' and 'thermal-fix' into release
      6288cf1e
    • L
      x86 idle: deprecate mwait_idle() and "idle=mwait" cmdline param · 5d4c47e0
      Len Brown 提交于
      mwait_idle() is a C1-only idle loop intended to be more efficient
      than HLT on SMP hardware that supports it.
      
      But mwait_idle() has been replaced by the more general
      mwait_idle_with_hints(), which handles both C1 and deeper C-states.
      ACPI uses only mwait_idle_with_hints(), and never uses mwait_idle().
      
      Deprecate mwait_idle() and the "idle=mwait" cmdline param
      to simplify the x86 idle code.
      
      After this change, kernels configured with
      (!CONFIG_ACPI=n && !CONFIG_INTEL_IDLE=n) when run on hardware
      that support MWAIT will simply use HLT.  If MWAIT is desired
      on those systems, cpuidle and the cpuidle drivers above
      can be used.
      
      cc: x86@kernel.org
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      5d4c47e0
    • L
      x86 idle: deprecate "no-hlt" cmdline param · cdaab4a0
      Len Brown 提交于
      We'd rather that modern machines not check if HLT works on
      every entry into idle, for the benefit of machines that had
      marginal electricals 15-years ago.  If those machines are still running
      the upstream kernel, they can use "idle=poll".  The only difference
      will be that they'll now invoke HLT in machine_hlt().
      
      cc: x86@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      cdaab4a0
    • L
      x86 idle APM: deprecate CONFIG_APM_CPU_IDLE · 99c63221
      Len Brown 提交于
      We don't want to export the pm_idle function pointer to modules.
      Currently CONFIG_APM_CPU_IDLE w/ CONFIG_APM_MODULE forces us to.
      
      CONFIG_APM_CPU_IDLE is of dubious value, it runs only on 32-bit
      uniprocessor laptops that are over 10 years old.  It calls into
      the BIOS during idle, and is known to cause a number of machines
      to fail.
      
      Removing CONFIG_APM_CPU_IDLE and will allow us to stop exporting
      pm_idle.  Any systems that were calling into the APM BIOS
      at run-time will simply use HLT instead.
      
      cc: x86@kernel.org
      cc: Jiri Kosina <jkosina@suse.cz>
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      99c63221
    • L
      x86 idle floppy: deprecate disable_hlt() · 3b70b2e5
      Len Brown 提交于
      Plan to remove floppy_disable_hlt in 2012, an ancient
      workaround with comments that it should be removed.
      
      This allows us to remove clutter and a run-time branch
      from the idle code.
      
      WARN_ONCE() on invocation until it is removed.
      
      cc: x86@kernel.org
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      3b70b2e5
    • L
      x86 idle: EXPORT_SYMBOL(default_idle, pm_idle) only when APM demands it · 06ae40ce
      Len Brown 提交于
      In the long run, we don't want default_idle() or (pm_idle)() to
      be exported outside of process.c.  Start by not exporting them
      to modules, unless the APM build demands it.
      
      cc: x86@kernel.org
      cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      06ae40ce
    • L
      x86 idle: clarify AMD erratum 400 workaround · 02c68a02
      Len Brown 提交于
      The workaround for AMD erratum 400 uses the term "c1e" falsely suggesting:
      1. Intel C1E is somehow involved
      2. All AMD processors with C1E are involved
      
      Use the string "amd_c1e" instead of simply "c1e" to clarify that
      this workaround is specific to AMD's version of C1E.
      Use the string "e400" to clarify that the workaround is specific
      to AMD processors with Erratum 400.
      
      This patch is text-substitution only, with no functional change.
      
      cc: x86@kernel.org
      Acked-by: NBorislav Petkov <borislav.petkov@amd.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      02c68a02
    • Z
      ACPI EC: remove redundant code · 08b53f0e
      Zhang Rui 提交于
      ec->handle is set in ec_parse_device(), so don't bother to set it again.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      08b53f0e
    • L
      ACPI: Add D3 cold state · 28c2103d
      Lin Ming 提交于
      _SxW returns an Integer containing the lowest D-state supported in state
      Sx. If OSPM has not indicated that it supports _PR3, then the value “3”
      corresponds to D3.  If it has indicated _PR3 support, the value “3”
      represents D3hot and the value “4” represents D3cold.
      
      Linux does set _OSC._PR3, so we should fix it to expect that _SxW can
      return 4.
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      28c2103d
    • L
      ACPI: processor: fix processor_physically_present in UP kernel · 932df741
      Lin Ming 提交于
      Usually, there are multiple processors defined in ACPI table, for
      example
      
          Scope (_PR)
          {
              Processor (CPU0, 0x00, 0x00000410, 0x06) {}
              Processor (CPU1, 0x01, 0x00000410, 0x06) {}
              Processor (CPU2, 0x02, 0x00000410, 0x06) {}
              Processor (CPU3, 0x03, 0x00000410, 0x06) {}
          }
      
      processor_physically_present(...) will be called to check whether those
      processors are physically present.
      
      Currently we have below codes in processor_physically_present,
      
      cpuid = acpi_get_cpuid(...);
      if ((cpuid == -1) && (num_possible_cpus() > 1))
              return false;
      return true;
      
      In UP kernel, acpi_get_cpuid(...) always return -1 and
      num_possible_cpus() always return 1, so
      processor_physically_present(...) always returns true for all passed in
      processor handles.
      
      This is wrong for UP processor or SMP processor running UP kernel.
      
      This patch removes the !SMP version of acpi_get_cpuid(), so both UP and
      SMP kernel use the same acpi_get_cpuid function.
      
      And for UP kernel, only processor 0 is valid.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=16548
      https://bugzilla.kernel.org/show_bug.cgi?id=16357Tested-by: NAnton Kochkov <anton.kochkov@gmail.com>
      Tested-by: NAmbroz Bizjak <ambrop7@gmail.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      932df741
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin · 139f37f5
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
        Blackfin: debug-mmrs: include RSI_PID[4567] MMRs
        Blackfin: bf51x: fix up RSI_PID# MMR defines
        Blackfin: bf52x/bf54x: fix up usb MMR defines
        Blackfin: debug-mmrs: fix typos with gptimers/mdma/ppi
        Blackfin: gptimers: add structure for hardware register layout
        Blackfin: wire up new sendmmsg syscall
        Blackfin: mach/bfin_serial_5xx.h: punt now-unused header
        Blackfin: bfin_serial.h: turn default port wrappers into stubs
      139f37f5
    • R
      scsi: fix scsi_proc new kernel-doc warning · 5be7ef00
      Randy Dunlap 提交于
      Fix kernel-doc warnings in scsi_proc.c:
      
        Warning(drivers/scsi/scsi_proc.c:390): No description found for parameter 'dev'
        Warning(drivers/scsi/scsi_proc.c:390): No description found for parameter 'data'
        Warning(drivers/scsi/scsi_proc.c:390): Excess function parameter 's' description in 'always_match'
        Warning(drivers/scsi/scsi_proc.c:390): Excess function parameter 'p' description in 'always_match'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5be7ef00
    • T
      ACPI: Split out custom_method functionality into an own driver · 526b4af4
      Thomas Renninger 提交于
      With /sys/kernel/debug/acpi/custom_method root can write
      to arbitrary memory and increase his priveleges, even if
      these are restricted.
      
      -> Make this an own debug .config option and warn about the
      security issue in the config description.
      
      -> Still keep acpi/debugfs.c which now only creates an empty
         /sys/kernel/debug/acpi directory. There might be other
         users of it later.
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: rui.zhang@intel.com
      Signed-off-by: NLen Brown <len.brown@intel.com>
      526b4af4
    • T
      ACPI: Cleanup custom_method debug stuff · aecad432
      Thomas Renninger 提交于
      - Move param aml_debug_output to other params into sysfs.c
      - Split acpi_debugfs_init to prepare custom_method to be
        an own .config option and driver.
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: rui.zhang@intel.com
      Signed-off-by: NLen Brown <len.brown@intel.com>
      aecad432