Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp845328pxa; Wed, 5 Aug 2020 14:21:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMNsA/P7KKQ25m/QiygCsnfS77ly9quUseOuraqGXYJgCDYgjXyLc5GaVaE7e+6aG/8PdM X-Received: by 2002:a05:6402:1545:: with SMTP id p5mr1150572edx.388.1596662486280; Wed, 05 Aug 2020 14:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596662486; cv=none; d=google.com; s=arc-20160816; b=XYuKvVo/+9JctOWHNNNRIhzUA5lAFoZvF68tcYj0XHW7O9gB6MxRjC44Rvog34dCPS sLhwsbhq8ErLWB+FwBieJJFO9lJn7cieVJkAUvWQVA0h6zB+Z3ax1BCUYIoMEe6MUyKx 9jSDkxLsx74EWhtYB72NDAh7lAYxN2t0bgR1ANs8FUdSuqESVTF6bu70cYbzEAdweByM If36KKQQRbrQjUKNIC8dqX37+p3ugYpBb6n4LKh2JY401+My1R0TKOm5Hr+gYRNpQ0/K kgbUMrFzqKY5QCB2rJt7zL+k5KeC0xjZM+2OgDsSTWTxNtTbuSC7pn4DfaDOls0xbxvY 6KvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=47Asclv1FK7U2jk7VK/Qqzc/1uZms3QEdnET+4/Hxhw=; b=Hlb95Pwi5iiwSxzeCkAKiOUvWb8b7NNP74BcrjhE5IQ5xxNY1H1PuH0klMZCdIGrti tO61RXAB3etudjcX50Eps2SjXM3ezn0tvu+elVgiqfMdUCsJdLTdt5Wm4hJ3bY82/jRq GA3GiRO7yABdEM10UishcGWcuzFOd3UXQ6k1hiT3wn6COv+4YnkJifKRosOx0KKQ3/CY FLAW7QrUM79rwLMR6HqFPb/T9K5vsA8kNA3dfULFDdIx7q8KLANF4mK8XM3BwP661AGb dtZRNztjkVpoq1lj6Vqqq3QMoYfZ7l7WYNJCiTljURE/4WtmOc9J/uIwUkiRf7mMRdyB 3A+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hOGXqAlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x25si1984354edr.231.2020.08.05.14.21.02; Wed, 05 Aug 2020 14:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hOGXqAlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726158AbgHEVSl (ORCPT + 99 others); Wed, 5 Aug 2020 17:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725139AbgHEVSk (ORCPT ); Wed, 5 Aug 2020 17:18:40 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA130C061575; Wed, 5 Aug 2020 14:18:40 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id y18so30216182ilp.10; Wed, 05 Aug 2020 14:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=47Asclv1FK7U2jk7VK/Qqzc/1uZms3QEdnET+4/Hxhw=; b=hOGXqAlmNmwjcpWgNq+i7sz0gXOY45BTpoSEyZ7rQgxc8KoTFIq72+Sp3FqRmWUGch BzMjQw9EsuXc1EkXuw4M/HNTKNKhWg44QfrlbEhDfVbFKVwxiTH5fO+RBDpeSKYxhAOr 97nXaQN3SqulrQyeviEqOelMhLmtmdfPAGHC0nT6CaFiG+qOGEZpu2Ks27v8ughOlpC1 us7d21TosVqDjmVTvwK4B6ovXoFxFbmAQXDdijY/4Ha+hwaSLqvZ1ShYcNjiOS3ASxsx nfMOwaEzMpqofoyw6UO9W6ksT52pUAYn7Fq1VrJHLjX1Fae7VbB0QTJ/W1+55pFwDJNQ CPqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=47Asclv1FK7U2jk7VK/Qqzc/1uZms3QEdnET+4/Hxhw=; b=hefQ2q6qD6cboAb4CQjry3Jv0Cq3jjY/HZiqof3KHLz5NvlxNJw+ZWPoIm+GL+1iR/ mZxosLlM77ZOWc+N8iJn81EQClQ5qKwZPrDfV6YqHn7mP6o7jEFbiv0Ft57/MqUJYrbE oN6Jkuoq1PnHRXsLs8wqGB6ody02RvlWOogwP6r2pBatFIYZeEiA9H9w8SQWR7PgGcOi vbfGD0lMmcR5IHNZ0avxRUgQCBp7YQp0TlfXQ3M68Wn9pBu2Gl5Xk4EZrBWumtCJsmOx 6SOqF3HEMZv0ucSprOPu+vce2WlzNH/viSFYFO5vc2z6RxW1eYCmdnbEFiPpu0YzrxBm Mv/A== X-Gm-Message-State: AOAM5309HF4k1q5TQn15WajYHkQZYb0Su/B9qpdWshiISI19SFMhdq98 rCIAtrh4kQCrn6aqUgdNzbMNPVWb2swvAT0ixNU= X-Received: by 2002:a92:bb92:: with SMTP id x18mr5788263ilk.64.1596662319442; Wed, 05 Aug 2020 14:18:39 -0700 (PDT) MIME-Version: 1.0 References: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> <1595681998-19193-12-git-send-email-alex.shi@linux.alibaba.com> In-Reply-To: <1595681998-19193-12-git-send-email-alex.shi@linux.alibaba.com> From: Alexander Duyck Date: Wed, 5 Aug 2020 14:18:28 -0700 Message-ID: Subject: Re: [PATCH v17 11/21] mm/lru: move lru_lock holding in func lru_note_cost_page To: Alex Shi Cc: Andrew Morton , Mel Gorman , Tejun Heo , Hugh Dickins , Konstantin Khlebnikov , Daniel Jordan , Yang Shi , Matthew Wilcox , Johannes Weiner , kbuild test robot , linux-mm , LKML , cgroups@vger.kernel.org, Shakeel Butt , Joonsoo Kim , Wei Yang , "Kirill A. Shutemov" , Rong Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 25, 2020 at 6:00 AM Alex Shi wrote: > > It's a clean up patch w/o function changes. > > Signed-off-by: Alex Shi > Cc: Johannes Weiner > Cc: Andrew Morton > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org Reviewed-by: Alexander Duyck > --- > mm/memory.c | 3 --- > mm/swap.c | 2 ++ > mm/swap_state.c | 2 -- > mm/workingset.c | 2 -- > 4 files changed, 2 insertions(+), 7 deletions(-) > > diff --git a/mm/memory.c b/mm/memory.c > index 87ec87cdc1ff..dafc5585517e 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3150,10 +3150,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) > * XXX: Move to lru_cache_add() when it > * supports new vs putback > */ > - spin_lock_irq(&page_pgdat(page)->lru_lock); > lru_note_cost_page(page); > - spin_unlock_irq(&page_pgdat(page)->lru_lock); > - > lru_cache_add(page); > swap_readpage(page, true); > } > diff --git a/mm/swap.c b/mm/swap.c > index dc8b02cdddcb..b88ca630db70 100644 > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -298,8 +298,10 @@ void lru_note_cost(struct lruvec *lruvec, bool file, unsigned int nr_pages) > > void lru_note_cost_page(struct page *page) > { > + spin_lock_irq(&page_pgdat(page)->lru_lock); > lru_note_cost(mem_cgroup_page_lruvec(page, page_pgdat(page)), > page_is_file_lru(page), hpage_nr_pages(page)); > + spin_unlock_irq(&page_pgdat(page)->lru_lock); > } > > static void __activate_page(struct page *page, struct lruvec *lruvec) > diff --git a/mm/swap_state.c b/mm/swap_state.c > index 05889e8e3c97..080be52db6a8 100644 > --- a/mm/swap_state.c > +++ b/mm/swap_state.c > @@ -440,9 +440,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, > } > > /* XXX: Move to lru_cache_add() when it supports new vs putback */ > - spin_lock_irq(&page_pgdat(page)->lru_lock); > lru_note_cost_page(page); > - spin_unlock_irq(&page_pgdat(page)->lru_lock); > > /* Caller will initiate read into locked page */ > SetPageWorkingset(page); > diff --git a/mm/workingset.c b/mm/workingset.c > index 50b7937bab32..337d5b9ad132 100644 > --- a/mm/workingset.c > +++ b/mm/workingset.c > @@ -372,9 +372,7 @@ void workingset_refault(struct page *page, void *shadow) > if (workingset) { > SetPageWorkingset(page); > /* XXX: Move to lru_cache_add() when it supports new vs putback */ > - spin_lock_irq(&page_pgdat(page)->lru_lock); > lru_note_cost_page(page); > - spin_unlock_irq(&page_pgdat(page)->lru_lock); > inc_lruvec_state(lruvec, WORKINGSET_RESTORE); > } > out: > -- > 1.8.3.1 >