From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>, Rik van Riel <riel@redhat.com>,
Mel Gorman <mgorman@suse.de>, Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Pavel Emelyanov <xemul@parallels.com>,
Yalin Wang <yalin.wang@sonymobile.com>
Subject: Re: [RFC 3/6] mm: mark dirty bit on swapped-in page
Date: Wed, 10 Jun 2015 11:05:50 +0300 [thread overview]
Message-ID: <20150610080550.GC13008@uranus> (raw)
In-Reply-To: <20150610080035.GA32731@blaptop>
On Wed, Jun 10, 2015 at 05:00:35PM +0900, Minchan Kim wrote:
> >
> > Ah, I recall. If there is no way to escape dirtifying the page in pte itself
> > maybe we should at least not make it softdirty on read faults?
>
> You mean this?
>
> diff --git a/mm/memory.c b/mm/memory.c
> index e1c45d0..c95340d 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2557,9 +2557,14 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
>
> inc_mm_counter_fast(mm, MM_ANONPAGES);
> dec_mm_counter_fast(mm, MM_SWAPENTS);
> - pte = mk_pte(page, vma->vm_page_prot);
> +
> + /* Mark dirty bit of page table because MADV_FREE relies on it */
> + pte = pte_mkdirty(mk_pte(page, vma->vm_page_prot));
> + if (!flgas & FAULT_FLAG_WRITE)
> + pte = pte_clear_flags(pte, _PAGE_SOFT_DIRTY)
> +
> if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) {
> - pte = maybe_mkwrite(pte_mkdirty(pte), vma);
> + pte = maybe_mkwrite(pte, vma);
> flags &= ~FAULT_FLAG_WRITE;
> ret |= VM_FAULT_WRITE;
> exclusive = 1;
>
> It could be doable if everyone doesn't have strong objection
> on this patchset.
>
> I will wait more review.
Yeah, something like this. Lets wait for opinions, thanks!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>, Rik van Riel <riel@redhat.com>,
Mel Gorman <mgorman@suse.de>, Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Pavel Emelyanov <xemul@parallels.com>,
Yalin Wang <yalin.wang@sonymobile.com>
Subject: Re: [RFC 3/6] mm: mark dirty bit on swapped-in page
Date: Wed, 10 Jun 2015 11:05:50 +0300 [thread overview]
Message-ID: <20150610080550.GC13008@uranus> (raw)
In-Reply-To: <20150610080035.GA32731@blaptop>
On Wed, Jun 10, 2015 at 05:00:35PM +0900, Minchan Kim wrote:
> >
> > Ah, I recall. If there is no way to escape dirtifying the page in pte itself
> > maybe we should at least not make it softdirty on read faults?
>
> You mean this?
>
> diff --git a/mm/memory.c b/mm/memory.c
> index e1c45d0..c95340d 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2557,9 +2557,14 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
>
> inc_mm_counter_fast(mm, MM_ANONPAGES);
> dec_mm_counter_fast(mm, MM_SWAPENTS);
> - pte = mk_pte(page, vma->vm_page_prot);
> +
> + /* Mark dirty bit of page table because MADV_FREE relies on it */
> + pte = pte_mkdirty(mk_pte(page, vma->vm_page_prot));
> + if (!flgas & FAULT_FLAG_WRITE)
> + pte = pte_clear_flags(pte, _PAGE_SOFT_DIRTY)
> +
> if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) {
> - pte = maybe_mkwrite(pte_mkdirty(pte), vma);
> + pte = maybe_mkwrite(pte, vma);
> flags &= ~FAULT_FLAG_WRITE;
> ret |= VM_FAULT_WRITE;
> exclusive = 1;
>
> It could be doable if everyone doesn't have strong objection
> on this patchset.
>
> I will wait more review.
Yeah, something like this. Lets wait for opinions, thanks!
next prev parent reply other threads:[~2015-06-10 8:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 6:15 [RFC 0/6] MADV_FREE: respect pte_dirty, not PG_dirty Minchan Kim
2015-06-03 6:15 ` Minchan Kim
2015-06-03 6:15 ` [RFC 1/6] mm: keep dirty bit on KSM page Minchan Kim
2015-06-03 6:15 ` Minchan Kim
2015-06-03 6:15 ` [RFC 2/6] mm: keep dirty bit on anonymous page migration Minchan Kim
2015-06-03 6:15 ` Minchan Kim
2015-06-03 6:15 ` [RFC 3/6] mm: mark dirty bit on swapped-in page Minchan Kim
2015-06-03 6:15 ` Minchan Kim
2015-06-09 19:07 ` Cyrill Gorcunov
2015-06-09 19:07 ` Cyrill Gorcunov
2015-06-09 23:52 ` Minchan Kim
2015-06-09 23:52 ` Minchan Kim
2015-06-10 7:23 ` Cyrill Gorcunov
2015-06-10 7:23 ` Cyrill Gorcunov
2015-06-10 8:00 ` Minchan Kim
2015-06-10 8:00 ` Minchan Kim
2015-06-10 8:05 ` Cyrill Gorcunov [this message]
2015-06-10 8:05 ` Cyrill Gorcunov
2015-06-03 6:15 ` [RFC 4/6] mm: mark dirty bit on unuse_pte Minchan Kim
2015-06-03 6:15 ` Minchan Kim
2015-06-03 6:15 ` [RFC 5/6] mm: decouple PG_dirty from MADV_FREE Minchan Kim
2015-06-03 6:15 ` Minchan Kim
2015-06-03 6:15 ` [RFC 6/6] mm: MADV_FREE refactoring Minchan Kim
2015-06-03 6:15 ` Minchan Kim
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=20150610080550.GC13008@uranus \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=xemul@parallels.com \
--cc=yalin.wang@sonymobile.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.