Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4643747pxu; Mon, 21 Dec 2020 19:03:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2zAnyoqbrM9TsgmLa1F32JCsz16+aRkAdlWhp4m9W4ss+lEcqkqbNAJQgouxfzhw1brym X-Received: by 2002:a17:907:1607:: with SMTP id hb7mr17649604ejc.81.1608606235818; Mon, 21 Dec 2020 19:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608606235; cv=none; d=google.com; s=arc-20160816; b=Y7RNct8e9bFVGoTLe84ZV/NPhrt6l8Cyz6wsl3lC8x9E7QSkjsPxLQaeO8TMDJ/Cth SDojq/JaZnI0cFuFtwCUC+LIsExwA93iGMyAtYsieYcOIexeSmM6049dwYpQq8b2KjXF CJnfQkof6e8KuI+6KniPd3jrfW+r4Itogt4y1oVp2MALqFBt5JJ/di4PEt6NDod5iNln ky2gaENSLcWu81ZtcDmg1+jvLf8e+ywSJ9nOeidxQZE8U2XnNOcsPtShqZowD/LPo9Ff ZIHFNj7zW+/MpZHOxNTW0jVgnZu/YuHCCpxrlfXRQTP1Ijkl/XdYyIgGhdhhsqMu3HFf /khg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=xZEe9nKbt22VK8Tq7L3dwCEv8d6KPrIVgCMxlhwxx3Q=; b=ODGa+vJ/11RqRK7ZyAxHHjycdQpeRJyy/9eIFHMvqtWK5iOMpp+MEtAP+ihF04RFlq aQPPURTIf7FZOpsnE/PI2RtyuPDb7pWyR/puBeh3NGVtTHHcX3hnSQ/pD+aWoBLDfyrh QQd0+ocMlkX627YVtW8gfJKRXrz/YE4U7tKyDemuEs+d5yxRavuRKiqHw9I6HRQrfRcS Led6E6rFhAUOIZqYLY8GRRiUg9IOC4PN0396vpeq7Hovj00aAQgE0UWke2/0j1A5zIlt ClhTub+dkTiJjRLwTDzT7052KHl13zs2B6c5XMLWzsLFOcbprgkS1f38jhgqMOoJgtnd d63w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ToNIvWYM; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si11258547edr.197.2020.12.21.19.03.33; Mon, 21 Dec 2020 19:03:55 -0800 (PST) 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=@google.com header.s=20161025 header.b=ToNIvWYM; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726044AbgLVDCc (ORCPT + 99 others); Mon, 21 Dec 2020 22:02:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgLVDCb (ORCPT ); Mon, 21 Dec 2020 22:02:31 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF14C0613D3 for ; Mon, 21 Dec 2020 19:01:51 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id hk16so555698pjb.4 for ; Mon, 21 Dec 2020 19:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=xZEe9nKbt22VK8Tq7L3dwCEv8d6KPrIVgCMxlhwxx3Q=; b=ToNIvWYMRuu67rHR26AoZ8LITvFFxwKDzFXUBeCMHNVl9SKWs2JiL/rESRW/P6aWJy K6uYZlQtdKrjpUypOhtUEmTbzBVZ1JnAbGM/S6YJMjCxSnF+nSUXZCn3KOFY2LvCS6yz yc7Ey0QONEBlbY7YFA13knO/pXtKTn6amSjABq3fNCUIvqUyZI1X2Z8kVdkrs0YKXy/X dEzx3hydhKrzU/EAU6oDiekbRHBwAXYr4n9POMB0yGtPsLSNA9+Be7PDY1SzMd5y2a+n 5SeCwkA5h823mfelQnl3wo05eq4v51qbunVKJ1C1tFvEVszIU8m/T2XG6s27myJXTfMl pMlQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=xZEe9nKbt22VK8Tq7L3dwCEv8d6KPrIVgCMxlhwxx3Q=; b=IztqieCBpGjxlHyEN/jt6RoJOQZ7vvCZSG4D1ucWqWWcaI7fD61wA3TIGuFqniuZjh Iajb6x/uWRiemt76l24ZO71OFrzw5edoKedqQvp8Y1SHe/Kk2Ga+XdW/Vqim16juNyI4 lPzA//vSL6xVeZIr4urY/w++nnnW0zVIGqHPeXtg+ccWOJL7xUM7fhink6UZNAP59iiK E9MRnTM0Wjqd8zPrT2F9T6exKpoBNPd0PWMask35mAvIGTP+xqqQYumgh9OCfNxG9cRF xOibW4XwDxxigH8E0MGParicpml60Um+lGOvzxjFwwgt7jQLrk8lo6twSwrSmNDRRg4y ZO2w== X-Gm-Message-State: AOAM532Ac7peU8hv7nv1uecOheS+Nszk9anNkXhBbivP0l9ibbpRVFxj nv5OjKTq+Nw2cM0bDVRifdIgpg== X-Received: by 2002:a17:90a:d502:: with SMTP id t2mr19389131pju.131.1608606110682; Mon, 21 Dec 2020 19:01:50 -0800 (PST) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id t22sm17623091pgm.18.2020.12.21.19.01.49 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Mon, 21 Dec 2020 19:01:49 -0800 (PST) Date: Mon, 21 Dec 2020 19:01:37 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Alex Shi cc: Andrew Morton , Hugh Dickins , Johannes Weiner , Michal Hocko , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mm/memcg: revise the using condition of lock_page_lruvec function series In-Reply-To: <1608186532-81218-1-git-send-email-alex.shi@linux.alibaba.com> Message-ID: References: <1608186532-81218-1-git-send-email-alex.shi@linux.alibaba.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Dec 2020, Alex Shi wrote: > The series function could be used under lock_page_memcg(), add this and > a bit style changes following commit_charge(). > > Signed-off-by: Alex Shi > Cc: Hugh Dickins This patch, or its intention, Acked-by: Hugh Dickins but rewording suggested below, and requested above - which left me very puzzled before eventually I understood it. I don't think we need to talk about "a bit style changes", but the cross-reference to commit_charge() is helpful. " lock_page_lruvec() and its variants are safe to use under the same conditions as commit_charge(): add lock_page_memcg() to the comment. " > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Vladimir Davydov > Cc: Andrew Morton > Cc: cgroups@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > --- > mm/memcontrol.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index b80328f52fb4..e6b50d068b2f 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -1345,10 +1345,11 @@ void lruvec_memcg_debug(struct lruvec *lruvec, struct page *page) > * lock_page_lruvec - lock and return lruvec for a given page. > * @page: the page > * > - * This series functions should be used in either conditions: > - * PageLRU is cleared or unset > - * or page->_refcount is zero > - * or page is locked. > + * This series functions should be used in any one of following conditions: These functions are safe to use under any of the following conditions: > + * - PageLRU is cleared or unset > + * - page->_refcount is zero > + * - page is locked. Remove that full stop... > + * - lock_page_memcg() ... and, if you wish (I don't care), add full stop at the end of that line. Maybe reorder those to the same order as listed in commit_charge(). Copy its text exactly? I don't think so, actually, I find your wording (e.g. _refcount is zero) more explicit: good to have both descriptions. > */ > struct lruvec *lock_page_lruvec(struct page *page) > { > -- > 2.29.GIT