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=-16.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham 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 60EDCC433E0 for ; Tue, 22 Dec 2020 05:23:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9E6F23122 for ; Tue, 22 Dec 2020 05:23:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9E6F23122 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 398C08D000B; Tue, 22 Dec 2020 00:23:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36FB08D0009; Tue, 22 Dec 2020 00:23:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 286218D000B; Tue, 22 Dec 2020 00:23:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 0E97E8D0009 for ; Tue, 22 Dec 2020 00:23:13 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BF1668249980 for ; Tue, 22 Dec 2020 05:23:12 +0000 (UTC) X-FDA: 77619774624.23.hose73_170549b2745d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 9F70937604 for ; Tue, 22 Dec 2020 05:23:12 +0000 (UTC) X-HE-Tag: hose73_170549b2745d X-Filterd-Recvd-Size: 4105 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 05:23:11 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R731e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UJPXZ7P_1608614586; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UJPXZ7P_1608614586) by smtp.aliyun-inc.com(127.0.0.1); Tue, 22 Dec 2020 13:23:06 +0800 Subject: Re: [PATCH 1/3] mm/memcg: revise the using condition of lock_page_lruvec function series To: Hugh Dickins Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1608186532-81218-1-git-send-email-alex.shi@linux.alibaba.com> From: Alex Shi Message-ID: Date: Tue, 22 Dec 2020 13:23:06 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: =D4=DA 2020/12/22 =C9=CF=CE=E711:01, Hugh Dickins =D0=B4=B5=C0: > On Thu, 17 Dec 2020, Alex Shi wrote: >=20 >> The series function could be used under lock_page_memcg(), add this an= d >> a bit style changes following commit_charge(). >> >> Signed-off-by: Alex Shi >> Cc: Hugh Dickins >=20 > 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. >=20 > " > lock_page_lruvec() and its variants are safe to use under the same > conditions as commit_charge(): add lock_page_memcg() to the comment. > " Thanks a lot, Hugh. Yes, your commit log are far more better than mine. := ) I will resent with your changes and Ack. Thanks! Alex >=20 >> 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 condi= tions: >=20 > These functions are safe to use under any of the following conditions: >=20 >> + * - PageLRU is cleared or unset >> + * - page->_refcount is zero >> + * - page is locked. >=20 > Remove that full stop... >=20 >> + * - lock_page_memcg() >=20 > ... and, if you wish (I don't care), add full stop at the end of that l= ine. >=20 > 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. >=20 >> */ >> struct lruvec *lock_page_lruvec(struct page *page) >> { >> --=20 >> 2.29.GIT