From: David Hildenbrand <david@redhat.com>
To: Stefan Roesch <shr@devkernel.io>, kernel-team@fb.com
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, riel@surriel.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Carl Klemm <carl@uvos.xyz>
Subject: Re: [PATCH v1 1/2] mm/ksm: support fork/exec for prctl
Date: Wed, 20 Sep 2023 15:11:21 +0200 [thread overview]
Message-ID: <a86b8604-befe-23d9-3f7b-34dbaf399adf@redhat.com> (raw)
In-Reply-To: <20230919205158.1897353-2-shr@devkernel.io>
On 19.09.23 22:51, Stefan Roesch wrote:
> A process can enable KSM with the prctl system call. When the process is
> forked the KSM flag is inherited by the child process. However if the
> process is executing an exec system call directly after the fork, the
> KSM setting is cleared. This patch addresses this problem.
>
> Signed-off-by: Stefan Roesch <shr@devkernel.io>
> Reported-by: Carl Klemm <carl@uvos.xyz>
> ---
> include/linux/sched/coredump.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
> index 0ee96ea7a0e9..205aa9917394 100644
> --- a/include/linux/sched/coredump.h
> +++ b/include/linux/sched/coredump.h
> @@ -87,8 +87,11 @@ static inline int get_dumpable(struct mm_struct *mm)
>
> #define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)
>
> +#define MMF_VM_MERGE_ANY 29
> +#define MMF_VM_MERGE_ANY_MASK (1 << MMF_VM_MERGE_ANY)
> +
> #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
> - MMF_DISABLE_THP_MASK | MMF_HAS_MDWE_MASK)
> + MMF_DISABLE_THP_MASK | MMF_HAS_MDWE_MASK |\
> + MMF_VM_MERGE_ANY_MASK)
>
> -#define MMF_VM_MERGE_ANY 29
> #endif /* _LINUX_SCHED_COREDUMP_H */
Fixes: tag?
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2023-09-20 13:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 20:51 [PATCH v1 0/2] mm/ksm: add fork-exec support " Stefan Roesch
2023-09-19 20:51 ` [PATCH v1 1/2] mm/ksm: support fork/exec " Stefan Roesch
2023-09-20 10:00 ` Carl Klemm
2023-09-20 13:11 ` David Hildenbrand [this message]
2023-09-20 16:29 ` Stefan Roesch
2023-09-19 20:51 ` [PATCH v1 2/2] mm/ksm: Test case for prctl fork/exec workflow Stefan Roesch
2023-09-20 13:16 ` David Hildenbrand
2023-09-20 18:57 ` Stefan Roesch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a86b8604-befe-23d9-3f7b-34dbaf399adf@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=carl@uvos.xyz \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@surriel.com \
--cc=shr@devkernel.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox