linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: David Hildenbrand <david@redhat.com>,
	Cyrill Gorcunov <gorcunov@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Paul Gofman <pgofman@codeweavers.com>,
	Nadav Amit <nadav.amit@gmail.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel@collabora.com
Subject: Re: [PATCH v4 1/3] mm/mprotect: Fix soft-dirty check in can_change_pte_writable()
Date: Tue, 20 Dec 2022 14:02:07 -0500	[thread overview]
Message-ID: <Y6IGr2Y21GlLTSRl@x1n> (raw)
In-Reply-To: <0a3e3397-6ff3-1203-52cb-49636ef38247@collabora.com>

On Tue, Dec 20, 2022 at 11:15:00PM +0500, Muhammad Usama Anjum wrote:
> Hi Peter,

Hi, Muhammad,

[...]

> Nothing has changed for the userspace. But when the default soft-dirty
> feature always updates the soft-dirty flag in the PTEs regardless of
> VM_SOFTDIRTY is set or not

But it was not?  I don't see why the pte flags must be considered at all if
VM_SOFTDIRTY is set in existing code base, or before this patch.

> why does other components of the mm stop caring for soft-dirty flag in
> the PTE when VM_SOFTDIRTY is set?
> 
> > 
> > Your approach introduced PAGEMAP_NO_REUSED_REGIONS but that special
> > information is not remembered in vma, IIUC that's why you find things
> > messed up.  Fundamentally, it's because you're trying to reuse soft-dirty
> > design but it's not completely soft-dirty anymore.
> Correct, that's why I'm trying to find a way to correct the soft-dirty
> support instead of using anything else. We should try and correct it. I've
> sent a RFC to track the soft-dirty flags for sub regions in the VMA.

Note that I'm not against the change if that's servicing the purpose of the
enhancement you're proposing.  But again I wouldn't use "correct" as the
word here because I still didn't see anything wrong with the old code.

so IMHO the extra complexity on handling VM_SOFTDIRTY (even if to drop it
and replace with other structures to maintain ranged soft-dirty) needs to
be justified along with the feature introduced, not be justified as a fix.

Thanks,

-- 
Peter Xu



  reply	other threads:[~2022-12-20 19:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 14:20 [PATCH v4 0/3] mm/mprotect: Fix soft-dirty checks Peter Xu
2022-07-25 14:20 ` [PATCH v4 1/3] mm/mprotect: Fix soft-dirty check in can_change_pte_writable() Peter Xu
2022-11-18 20:16   ` Muhammad Usama Anjum
2022-11-18 23:14     ` Peter Xu
2022-11-21 14:57       ` Muhammad Usama Anjum
2022-11-21 21:17         ` Peter Xu
2022-12-19 12:19           ` Muhammad Usama Anjum
2022-12-20 16:03             ` Peter Xu
2022-12-20 18:15               ` Muhammad Usama Anjum
2022-12-20 19:02                 ` Peter Xu [this message]
2022-12-21  8:17                   ` Muhammad Usama Anjum
2022-12-28 14:14             ` Muhammad Usama Anjum
2023-01-02 12:29               ` David Hildenbrand
2022-07-25 14:20 ` [PATCH v4 2/3] selftests: soft-dirty: Add test for mprotect Peter Xu
2022-07-25 14:28   ` David Hildenbrand
2022-07-25 14:20 ` [PATCH v4 3/3] selftests: Add soft-dirty into run_vmtests.sh Peter Xu

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=Y6IGr2Y21GlLTSRl@x1n \
    --to=peterx@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=gorcunov@gmail.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nadav.amit@gmail.com \
    --cc=pgofman@codeweavers.com \
    --cc=usama.anjum@collabora.com \
    /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).