[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20180725074009.GU28386@dhcp22.suse.cz>
Date: Wed, 25 Jul 2018 09:40:09 +0200
From: Michal Hocko <mhocko@...nel.org>
To: "zhaowuyun@...gtech.com" <zhaowuyun@...gtech.com>
Cc: mgorman <mgorman@...hsingularity.net>,
akpm <akpm@...ux-foundation.org>, minchan <minchan@...nel.org>,
vinmenon <vinmenon@...eaurora.org>, hannes <hannes@...xchg.org>,
"hillf.zj" <hillf.zj@...baba-inc.com>,
linux-mm <linux-mm@...ck.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [PATCH] mm: disable preemption before swapcache_free
On Wed 25-07-18 14:37:58, zhaowuyun@...gtech.com wrote:
[...]
> Change-Id: I36d9df7ccff77c589b7157225410269c675a8504
What is this?
> Signed-off-by: zhaowuyun <zhaowuyun@...gtech.com>
> ---
> mm/vmscan.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 2740973..acede002 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -674,6 +674,12 @@ static int __remove_mapping(struct address_space *mapping, struct page *page,
> BUG_ON(!PageLocked(page));
> BUG_ON(mapping != page_mapping(page));
> + /*
> + * preemption must be disabled to protect current task preempted before
> + * swapcache_free(swap) invoked by the task which do the
> + * __read_swap_cache_async job on the same page
> + */
> + preempt_disable();
> spin_lock_irqsave(&mapping->tree_lock, flags);
Hmm, but spin_lock_irqsave already implies the disabled preemption.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists