diff mbox series

[RFC,v2,1/9] mm: Add new mm flags for Copy-On-Write PTE table

Message ID 20220927162957.270460-2-shiyn.lin@gmail.com (mailing list archive)
State New
Headers show
Series Introduce Copy-On-Write to Page Table | expand

Commit Message

Chih-En Lin Sept. 27, 2022, 4:29 p.m. UTC
Add MMF_COW_PTE{, _READY} flags to prepare the subsequent
implementation of Copy-On-Write for the page table.

Signed-off-by: Chih-En Lin <shiyn.lin@gmail.com>
---
 include/linux/sched/coredump.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Nadav Amit Sept. 27, 2022, 5:23 p.m. UTC | #1
On Sep 27, 2022, at 9:29 AM, Chih-En Lin <shiyn.lin@gmail.com> wrote:

> Add MMF_COW_PTE{, _READY} flags to prepare the subsequent
> implementation of Copy-On-Write for the page table.
> 
> Signed-off-by: Chih-En Lin <shiyn.lin@gmail.com>
> ---
> include/linux/sched/coredump.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
> index 4d0a5be28b70f..f03ff69c90c8c 100644
> --- a/include/linux/sched/coredump.h
> +++ b/include/linux/sched/coredump.h
> @@ -84,7 +84,13 @@ static inline int get_dumpable(struct mm_struct *mm)
> #define MMF_HAS_PINNED		28	/* FOLL_PIN has run, never cleared */
> #define MMF_DISABLE_THP_MASK	(1 << MMF_DISABLE_THP)
> 
> +#define MMF_COW_PTE_READY	29
> +#define MMF_COW_PTE_READY_MASK	(1 << MMF_COW_PTE_READY)
> +
> +#define MMF_COW_PTE		30
> +#define MMF_COW_PTE_MASK	(1 << MMF_COW_PTE)

I am not sure how much sense it makes to put it in a separate patch, and it
is rather hard to understand the new flags without proper documentation and
comments.
Chih-En Lin Sept. 27, 2022, 5:36 p.m. UTC | #2
On Tue, Sep 27, 2022 at 05:23:58PM +0000, Nadav Amit wrote:
> On Sep 27, 2022, at 9:29 AM, Chih-En Lin <shiyn.lin@gmail.com> wrote:
> 
> > Add MMF_COW_PTE{, _READY} flags to prepare the subsequent
> > implementation of Copy-On-Write for the page table.
> > 
> > Signed-off-by: Chih-En Lin <shiyn.lin@gmail.com>
> > ---
> > include/linux/sched/coredump.h | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
> > index 4d0a5be28b70f..f03ff69c90c8c 100644
> > --- a/include/linux/sched/coredump.h
> > +++ b/include/linux/sched/coredump.h
> > @@ -84,7 +84,13 @@ static inline int get_dumpable(struct mm_struct *mm)
> > #define MMF_HAS_PINNED		28	/* FOLL_PIN has run, never cleared */
> > #define MMF_DISABLE_THP_MASK	(1 << MMF_DISABLE_THP)
> > 
> > +#define MMF_COW_PTE_READY	29
> > +#define MMF_COW_PTE_READY_MASK	(1 << MMF_COW_PTE_READY)
> > +
> > +#define MMF_COW_PTE		30
> > +#define MMF_COW_PTE_MASK	(1 << MMF_COW_PTE)
> 
> I am not sure how much sense it makes to put it in a separate patch, and it
> is rather hard to understand the new flags without proper documentation and
> comments.
> 

I had considered putting it with the sysctl patch, but since these two
flags are not related to the sysctl, so I put it in a separate patch.
Maybe I can put those (sysctl and this patch) together and take a
suitable commit message. I will consider it again.
For the proper documentation/comments, I will also add it in next
version.

Thanks,
Chih-En Lin
diff mbox series

Patch

diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
index 4d0a5be28b70f..f03ff69c90c8c 100644
--- a/include/linux/sched/coredump.h
+++ b/include/linux/sched/coredump.h
@@ -84,7 +84,13 @@  static inline int get_dumpable(struct mm_struct *mm)
 #define MMF_HAS_PINNED		28	/* FOLL_PIN has run, never cleared */
 #define MMF_DISABLE_THP_MASK	(1 << MMF_DISABLE_THP)
 
+#define MMF_COW_PTE_READY	29
+#define MMF_COW_PTE_READY_MASK	(1 << MMF_COW_PTE_READY)
+
+#define MMF_COW_PTE		30
+#define MMF_COW_PTE_MASK	(1 << MMF_COW_PTE)
+
 #define MMF_INIT_MASK		(MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
-				 MMF_DISABLE_THP_MASK)
+				 MMF_DISABLE_THP_MASK | MMF_COW_PTE_MASK)
 
 #endif /* _LINUX_SCHED_COREDUMP_H */