linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Minchan Kim <minchan@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Android Kernel Team <kernel-team@android.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Robert Love <rlove@google.com>, Mel Gorman <mel@csn.ul.ie>,
	Hugh Dickins <hughd@google.com>, Dave Hansen <dave@sr71.net>,
	Rik van Riel <riel@redhat.com>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	Neil Brown <neilb@suse.de>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Mike Hommey <mh@glandium.org>, Taras Glek <tglek@mozilla.com>,
	Jan Kara <jack@suse.cz>,
	KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	Michel Lespinasse <walken@google.com>,
	Keith Packard <keithp@keithp.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH 4/4] mvolatile: Add page purging logic & SIGBUS trap
Date: Wed, 16 Apr 2014 11:43:50 -0700	[thread overview]
Message-ID: <CALAqxLXqEhBDdzbq4iNa81w1fzTudL3o3ny4nGOOQdoM-DK=qA@mail.gmail.com> (raw)
In-Reply-To: <20140414025150.GC30991@bbox>

On Sun, Apr 13, 2014 at 7:51 PM, Minchan Kim <minchan@kernel.org> wrote:
> On Fri, Apr 11, 2014 at 01:15:40PM -0700, John Stultz wrote:
>> @@ -3643,6 +3644,8 @@ static int handle_pte_fault(struct mm_struct *mm,
>>
>>       entry = *pte;
>>       if (!pte_present(entry)) {
>> +             swp_entry_t mvolatile_entry;
>> +
>>               if (pte_none(entry)) {
>>                       if (vma->vm_ops) {
>>                               if (likely(vma->vm_ops->fault))
>> @@ -3652,6 +3655,11 @@ static int handle_pte_fault(struct mm_struct *mm,
>>                       return do_anonymous_page(mm, vma, address,
>>                                                pte, pmd, flags);
>>               }
>> +
>> +             mvolatile_entry = pte_to_swp_entry(entry);
>> +             if (unlikely(is_purged_entry(mvolatile_entry)))
>> +                     return VM_FAULT_SIGBUS;
>> +
>
> There is no pte lock so that is_purged_entry isn't safe so if race happens,
> do_swap_page could have a problem so it would be better to handle it
> do_swap_page with pte lock because we used swp_pte to indicate purged pte.
>
> I tried to solve it while we were in Napa(you could remember I sent
> crap patchset to you privately but failed to fix and I still didn't get
> a time to fix it :( ) but I'd like to inform this problem.

Thanks for the review and the reminder! I'll move the check appropriately.

thanks
-john

--
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>

      reply	other threads:[~2014-04-16 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 20:15 [PATCH 0/4] Volatile Ranges (v13) John Stultz
2014-04-11 20:15 ` [PATCH 1/4] swap: Cleanup how special swap file numbers are defined John Stultz
2014-04-11 20:15 ` [PATCH 2/4] mvolatile: Add mvolatile syscall and handle splitting/merging and marking vmas John Stultz
2014-04-11 20:15 ` [PATCH 3/4] mvolatile: Add purged page detection on setting memory non-volatile John Stultz
2014-04-14  2:37   ` Minchan Kim
2014-04-11 20:15 ` [PATCH 4/4] mvolatile: Add page purging logic & SIGBUS trap John Stultz
2014-04-14  2:51   ` Minchan Kim
2014-04-16 18:43     ` John Stultz [this message]

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='CALAqxLXqEhBDdzbq4iNa81w1fzTudL3o3ny4nGOOQdoM-DK=qA@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@sr71.net \
    --cc=dmitry.adamushko@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=keithp@keithp.com \
    --cc=kernel-team@android.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mh@glandium.org \
    --cc=minchan@kernel.org \
    --cc=neilb@suse.de \
    --cc=riel@redhat.com \
    --cc=rlove@google.com \
    --cc=tglek@mozilla.com \
    --cc=walken@google.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