[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALAqxLXqEhBDdzbq4iNa81w1fzTudL3o3ny4nGOOQdoM-DK=qA@mail.gmail.com>
Date: Wed, 16 Apr 2014 11:43:50 -0700
From: John Stultz <john.stultz@...aro.org>
To: Minchan Kim <minchan@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Android Kernel Team <kernel-team@...roid.com>,
Johannes Weiner <hannes@...xchg.org>,
Robert Love <rlove@...gle.com>, Mel Gorman <mel@....ul.ie>,
Hugh Dickins <hughd@...gle.com>, Dave Hansen <dave@...1.net>,
Rik van Riel <riel@...hat.com>,
Dmitry Adamushko <dmitry.adamushko@...il.com>,
Neil Brown <neilb@...e.de>,
Andrea Arcangeli <aarcange@...hat.com>,
Mike Hommey <mh@...ndium.org>, Taras Glek <tglek@...illa.com>,
Jan Kara <jack@...e.cz>,
KOSAKI Motohiro <kosaki.motohiro@...il.com>,
Michel Lespinasse <walken@...gle.com>,
Keith Packard <keithp@...thp.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH 4/4] mvolatile: Add page purging logic & SIGBUS trap
On Sun, Apr 13, 2014 at 7:51 PM, Minchan Kim <minchan@...nel.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists