From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Eric Biederman <ebiederm@xmission.com>,
Kees Cook <keescook@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
kernel@collabora.com, peterx@redhat.com, david@redhat.com,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] mm: implement granular soft-dirty vma support
Date: Tue, 10 Jan 2023 01:18:31 +0300 [thread overview]
Message-ID: <Y7ySt0XGnbzTyY6T@grain> (raw)
In-Reply-To: <20221220162606.1595355-1-usama.anjum@collabora.com>
On Tue, Dec 20, 2022 at 09:26:05PM +0500, Muhammad Usama Anjum wrote:
...
>
> +static inline int nsdr_adjust_new_first(struct vm_area_struct *new, struct vm_area_struct *vma)
> +{
> + struct non_sd_reg *r, *r_tmp, *reg;
> + unsigned long mid = vma->vm_start;
> +
> + list_for_each_entry_safe(r, r_tmp, &vma->non_sd_reg, nsdr_head) {
> + if (r->start < mid && r->end > mid) {
> + reg = kmalloc(sizeof(struct non_sd_reg), GFP_KERNEL);
> + if (!reg)
> + return -ENOMEM;
> + reg->start = r->start;
> + reg->end = mid;
> + list_add_tail(®->nsdr_head, &new->non_sd_reg);
> +
> + r->start = mid;
> + } else if (r->end <= mid) {
> + list_move_tail(&r->nsdr_head, &new->non_sd_reg);
> + }
> + }
> + return 0;
> +}
Hi Muhhamad, really sorry for delay. Please enlighten me here if I get your
idea right -- every new VMA merge might create a new non_sd_seg entry, right?
And this operation will be applied again and again until vma get freed. IOW
we gonna have a chain of non_sd_reg which will be hanging around until VMA
get freed, right?
next prev parent reply other threads:[~2023-01-09 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 16:26 [PATCH RFC] mm: implement granular soft-dirty vma support Muhammad Usama Anjum
2022-12-21 9:01 ` David Hildenbrand
2023-01-09 22:18 ` Cyrill Gorcunov [this message]
2023-01-10 5:49 ` Muhammad Usama Anjum
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=Y7ySt0XGnbzTyY6T@grain \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=ebiederm@xmission.com \
--cc=keescook@chromium.org \
--cc=kernel@collabora.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhiramat@kernel.org \
--cc=peterx@redhat.com \
--cc=rostedt@goodmis.org \
--cc=usama.anjum@collabora.com \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).