All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 4/4] ksm: add find_mergeable_vma_locked() to use per-VMA locking
@ 2026-11-09 17:43 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-11-09 17:43 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "linux-review patch is more than 7 days old, verify it wasn't already superseded"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261102133103.302832-1-xu.xin@linux.dev>
References: <20261102133103.302832-1-xu.xin@linux.dev>
TO: xu.xin@linux.dev
TO: xu.xin@linux.dev
CC: acme@kernel.org
CC: adrian.hunter@intel.com
CC: agordeev@linux.ibm.com
CC: akpm@linux-foundation.org
CC: alexander.shishkin@linux.intel.com
CC: apopple@nvidia.com
CC: baohua@kernel.org
CC: baolin.wang@linux.alibaba.com
CC: borntraeger@linux.ibm.com
CC: byungchul@sk.com
CC: chengming.zhou@linux.dev
CC: david@kernel.org
CC: dev.jain@arm.com
CC: gerald.schaefer@linux.ibm.com
CC: gor@linux.ibm.com
CC: gourry@gourry.net
CC: harry@kernel.org
CC: hca@linux.ibm.com
CC: irogers@google.com
CC: james.clark@linaro.org
CC: jannh@google.com
CC: jolsa@kernel.org
CC: joshua.hahnjy@gmail.com
CC: kas@kernel.org
CC: lance.yang@linux.dev
CC: liam@infradead.org
CC: linux-kernel@vger.kernel.org
CC: linux-mm@kvack.org
CC: linux-s390@vger.kernel.org

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/xu-xin-linux-dev/mm-pagewalk-delete-the-unused-member/20261102-212844
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20261102133103.302832-1-xu.xin%40linux.dev
patch subject: [PATCH v2 4/4] ksm: add find_mergeable_vma_locked() to use per-VMA locking
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20261110/202611100159.ZLtmDECp-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261110/202611100159.ZLtmDECp-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202611100159.ZLtmDECp-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> Warning: mm/ksm.c:805 function parameter 'mm' not described in 'find_mergeable_vma_locked'
>> Warning: mm/ksm.c:805 function parameter 'address' not described in 'find_mergeable_vma_locked'
>> Warning: mm/ksm.c:805 function parameter 'mm' not described in 'find_mergeable_vma_locked'
>> Warning: mm/ksm.c:805 function parameter 'address' not described in 'find_mergeable_vma_locked'

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH v2 0/4] mm/ksm: use per-VMA locking to reduce mmap_lock contention
@ 2026-11-02 13:24 xu.xin
  2026-11-02 13:31 ` [PATCH v2 4/4] ksm: add find_mergeable_vma_locked() to use per-VMA locking xu.xin
  0 siblings, 1 reply; 3+ messages in thread
From: xu.xin @ 2026-11-02 13:24 UTC (permalink / raw)
  To: akpm, david
  Cc: agordeev, gerald.schaefer, hca, gor, borntraeger, svens, ljs,
	liam, vbabka, rppt, surenb, mhocko, mhiramat, oleg, peterz, mingo,
	acme, namhyung, mark.rutland, alexander.shishkin, jolsa, irogers,
	adrian.hunter, james.clark, ziy, baolin.wang, nico.pache,
	ryan.roberts, dev.jain, baohua, lance.yang, usama.arif, kas,
	xu.xin, chengming.zhou, matthew.brost, joshua.hahnjy, byungchul,
	gourry, ying.huang, apopple, riel, harry, jannh, linux-s390,
	linux-kernel, linux-mm

From: Xu Xin <xu.xin@linux.dev>

KSM scans VM_MERGEABLE VMAs and currently protects each scan with
mmap_read_lock(). Per-VMA locking allows KSM to read-lock only the VMA
it is actually interested in, so that unrelated mmap()/munmap() activity
in the same mm no longer blocks ksmd.

This series is organized as follows:

  Patch 1 removes an unused 'vma' member from struct folio_walk.  It has
  never been used since its introduction and is pure cleanup.

  Patch 2 adds a 'walk_lock' member to struct folio_walk and extends
  folio_walk_start() to assert the required locking mode.  Existing
  callers are converted to pass PGWALK_RDLOCK, so there is no functional
  change.  This prepares folio_walk_start() for callers that hold a
  per-VMA read lock instead of mmap_read_lock(), which is needed by the
  Patch 4. No functional change.

  Patch 3 replaces the boolean 'lock_vma' argument of break_ksm() with a
  KSM-local enum ksm_walk_lock and builds the mm_walk_ops on the stack,
  so the function-pointer table stays const and there is no shared
  mutable state.  No functional change.

  Patch 4 introduces find_mergeable_vma_locked(), which uses the
  universal per-VMA locking helper vma_start_read_unlocked() to look up
  and read-lock a VM_MERGEABLE VMA without taking mmap_read_lock().  All
  KSM call sites that previously used find_mergeable_vma() under
  mmap_read_lock() are converted to the new helper, and the locking in
  get_mergeable_page() is switched to PGWALK_VMA_RDLOCK_VERIFY so that
  folio_walk_start() can verify the per-VMA lock is held.  Because ksmd
  no longer holds mmap_read_lock() while walking, __ksm_exit() must also
  write-lock every VMA (in addition to mmap_write_lock()) to keep
  serializing against an in-flight ksmd walk before the page tables are
  freed.

A microbenchmark was run to measure the time KSM takes to merge a
victim region under mmap_lock contention. Under interference from 4 churner
threads, the merge time of the per-VMA KSM-optimized kernel is
significantly reduced by 50%.

Changelog:
  v2:
  - Patch 1: rewrote the commit message to explain the introducing
    commit, how the VMA is actually used, and the audit performed;
    dropped the Fixes: tag.

  - Patch 3: 
    * replaced the boolean 'lock_vma' with a KSM-local enum
    ksm_walk_lock instead of exposing the internal enum page_walk_lock
    as a parameter;
    * build the mm_walk_ops on the stack rather than
    mutating a global struct, so the function-pointer table stays const
    and there is no shared mutable state; rewrote the commit message.

  - Patch 4:
    * Fixed a per-VMA read-lock leak in find_mergeable_vma_locked()
    when the VMA is not mergeable;
    made __ksm_exit() write-lock every VMA (vma_start_write()) in
    addition to mmap_write_lock(), so that it still serializes against a
    ksmd walk that holds only a per-VMA read lock.

Xu Xin (4):
  mm/pagewalk: delete the unused member
  mm: make folio_walk_start()'s locking asserts scalable
  mm/ksm: make break_ksm() more scalable
  ksm: add find_mergeable_vma_locked() to use per-VMA locking

 arch/s390/mm/fault.c     |   4 +-
 include/linux/pagewalk.h |   2 +-
 kernel/events/uprobes.c  |   4 +-
 mm/huge_memory.c         |   4 +-
 mm/ksm.c                 | 124 +++++++++++++++++++++++++++------------
 mm/migrate.c             |   8 ++-
 mm/pagewalk.c            |  10 +++-
 mm/rmap.c                |   4 +-
 8 files changed, 116 insertions(+), 44 deletions(-)

--
2.34.1



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

end of thread, other threads:[~2026-11-09 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09 17:43 [PATCH v2 4/4] ksm: add find_mergeable_vma_locked() to use per-VMA locking kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-11-02 13:24 [PATCH v2 0/4] mm/ksm: use per-VMA locking to reduce mmap_lock contention xu.xin
2026-11-02 13:31 ` [PATCH v2 4/4] ksm: add find_mergeable_vma_locked() to use per-VMA locking xu.xin
2026-11-03 13:31   ` sashiko-bot

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.