]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/madvise: deduplicate madvise_do_behavior() skip case handlings
authorSeongJae Park <sj@kernel.org>
Wed, 12 Mar 2025 16:47:49 +0000 (09:47 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Mar 2025 05:07:04 +0000 (22:07 -0700)
commit0a6ffacb3b42233fe44e0faedfcc8e83f9ad99c6
treecc640ad20add52912026832e8887d25003a74b16
parentf4a578d34590db42b4870ac694193413421610c1
mm/madvise: deduplicate madvise_do_behavior() skip case handlings

The logic for checking if a given madvise() request for a single memory
range can skip real work, namely madvise_do_behavior(), is duplicated in
do_madvise() and vector_madvise().  Split out the logic to a function and
reuse it.

Link: https://lkml.kernel.org/r/20250312164750.59215-4-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: David Hildenbrand <david@redhat.com>
Cc: Liam R. Howlett <howlett@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c