From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E8C3C388F7 for ; Tue, 10 Nov 2020 19:03:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC1BD20780 for ; Tue, 10 Nov 2020 19:03:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="oSzlQ+aZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC1BD20780 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 55D736B0036; Tue, 10 Nov 2020 14:03:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5362C6B005C; Tue, 10 Nov 2020 14:03:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FDCB6B005D; Tue, 10 Nov 2020 14:03:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id 1340D6B0036 for ; Tue, 10 Nov 2020 14:03:26 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id AE49C3622 for ; Tue, 10 Nov 2020 19:03:25 +0000 (UTC) X-FDA: 77469431970.10.cart30_50147ff272f7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 8BB4F16A07F for ; Tue, 10 Nov 2020 19:03:25 +0000 (UTC) X-HE-Tag: cart30_50147ff272f7 X-Filterd-Recvd-Size: 4709 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 19:03:24 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id v11so8994321qtq.12 for ; Tue, 10 Nov 2020 11:03:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IPj1mYmXqOWOz3TEiog9Zh5vT3acF5XixS22iuZzAIA=; b=oSzlQ+aZKJ+JtX7hBOzJ6QuxNdqcLauhjHFsVIve5PuHfOiAhBQP7vT28Pm0UhsV1F niWeWfpQFlQfk/RbeF3CC/XDpLPH8x2OpyaosMNkEKmofRAP2RLPWK0CISlT7mz8+k6L Ogvl1E8vhzyA4EBAyDF5hZ87LvKJk1nPjzHtRvVxPcpYstS8Y6gbvBorj4CWcBizdaci sXILka5r/IVEdHN6qNh+d4lj/vl6K02b9mjiEJEunCrInhniMjic3dfF9flk981t6QnU L47YPELx/y+49FzFNqmf4vmsapRk4D9hpHq2HOCrTOOAfkdrWtK6Z1iVx4ZUH2br1ppd lENw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IPj1mYmXqOWOz3TEiog9Zh5vT3acF5XixS22iuZzAIA=; b=dZqpD3hVjomZVomohdtJaLBd2idjAj/ufDNskQejL0KLcDw/0Onoe+exY8PbSHKCGm qDb2lP9bnA/AMEsdstroe4iD7pidxVHYGIPoE/ecLL5chvnzb/YMsRKXULQ5kFnBGuUz eZiCa9yJiMHWWEwQyWCxMSO5JPQofHcph0/DGEKM88mCf5pJzBHwu5r4OzMsblA3CyCy Dphq2x3jetR5w9bxxZzsGNH4VyrRbX+tx10stPYwigeIB8t14yLAROvAAE55hkSAiLZZ Qp9/qb3ty4ve/J6upW7iHqMR7gxWYCpdylO2uIs9VoS2vyFUC1khbjzgfrZNwy+Nl06r A7XQ== X-Gm-Message-State: AOAM530cD8tMmiDm5zso5olvqHYmEXhRZVZ4NNGCMvZZEoe4FSUw1WlM Y4kwX888lyOKrOPFT3vOTzpdBQ== X-Google-Smtp-Source: ABdhPJytHHzLMJg40qegnPnje7IYDJ+RMvN9cVBdzFFWhbDZGWSSHK7faXUGzh+ZUmYD25cREX9xVg== X-Received: by 2002:ac8:6682:: with SMTP id d2mr8584069qtp.349.1605035004225; Tue, 10 Nov 2020 11:03:24 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:64f7]) by smtp.gmail.com with ESMTPSA id p13sm8604430qti.58.2020.11.10.11.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 11:03:23 -0800 (PST) Date: Tue, 10 Nov 2020 14:01:36 -0500 From: Johannes Weiner To: Alex Shi Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, willy@infradead.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com, Vlastimil Babka , Minchan Kim Subject: Re: [PATCH v21 07/19] mm: page_idle_get_page() does not need lru_lock Message-ID: <20201110190136.GD850433@cmpxchg.org> References: <1604566549-62481-1-git-send-email-alex.shi@linux.alibaba.com> <1604566549-62481-8-git-send-email-alex.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1604566549-62481-8-git-send-email-alex.shi@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000043, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 05, 2020 at 04:55:37PM +0800, Alex Shi wrote: > From: Hugh Dickins > > It is necessary for page_idle_get_page() to recheck PageLRU() after > get_page_unless_zero(), but holding lru_lock around that serves no > useful purpose, and adds to lru_lock contention: delete it. > > See https://lore.kernel.org/lkml/20150504031722.GA2768@blaptop for the > discussion that led to lru_lock there; but __page_set_anon_rmap() now > uses WRITE_ONCE(), and I see no other risk in page_idle_clear_pte_refs() > using rmap_walk() (beyond the risk of racing PageAnon->PageKsm, mostly > but not entirely prevented by page_count() check in ksm.c's > write_protect_page(): that risk being shared with page_referenced() and > not helped by lru_lock). > > Signed-off-by: Hugh Dickins > Signed-off-by: Alex Shi > Cc: Andrew Morton > Cc: Vladimir Davydov > Cc: Vlastimil Babka > Cc: Minchan Kim > Cc: Alex Shi > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org Acked-by: Johannes Weiner