[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42df1c58-f0bf-5dd8-03db-ee2fa28d7c1b@linux.ibm.com>
Date: Wed, 19 Apr 2023 13:39:12 +0200
From: Janosch Frank <frankja@...ux.ibm.com>
To: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, linux-s390@...r.kernel.org,
linux-kselftest@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Stefan Roesch <shr@...kernel.io>,
Rik van Riel <riel@...riel.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH v1 3/3] mm/ksm: move disabling KSM from s390/gmap code to
KSM code
On 4/18/23 17:28, David Hildenbrand wrote:
> Let's factor out actual disabling of KSM. The existing
> "mm->def_flags &= ~VM_MERGEABLE;" was essentially a NOP and can be dropped,
> because def_flags should never include VM_MERGEABLE. Note that we don't
> currently prevent re-enabling KSM.
>
> This should now be faster in case KSM was never enabled, because we only
> conditionally iterate all VMAs. Further, it certainly looks cleaner.
>
> Signed-off-by: David Hildenbrand <david@...hat.com>
> ---
> arch/s390/mm/gmap.c | 20 +-------------------
> include/linux/ksm.h | 6 ++++++
> mm/ksm.c | 11 +++++++++++
> 3 files changed, 18 insertions(+), 19 deletions(-)
>
> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
> index 0949811761e6..dfe905c7bd8e 100644
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -2585,30 +2585,12 @@ EXPORT_SYMBOL_GPL(s390_enable_sie);
>
> int gmap_mark_unmergeable(void)
> {
> - struct mm_struct *mm = current->mm;
> - struct vm_area_struct *vma;
> - unsigned long vm_flags;
> - int ret;
> - VMA_ITERATOR(vmi, mm, 0);
> -
> /*
> * Make sure to disable KSM (if enabled for the whole process or
> * individual VMAs). Note that nothing currently hinders user space
> * from re-enabling it.
> */
Is that still true?
My KSM knowledge is nearly zero but from what I can see the patch looks
ok to me:
Acked-by: Janosch Frank <frankja@...ux.ibm.net>
Powered by blists - more mailing lists