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 7563FC433E0 for ; Tue, 22 Dec 2020 05:23:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45E1D23122 for ; Tue, 22 Dec 2020 05:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726022AbgLVFXw (ORCPT ); Tue, 22 Dec 2020 00:23:52 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:57898 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbgLVFXw (ORCPT ); Tue, 22 Dec 2020 00:23:52 -0500 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: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ÔÚ 2020/12/22 ÉÏÎç11:01, Hugh Dickins дµÀ: > 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. > " Thanks a lot, Hugh. Yes, your commit log are far more better than mine. :) I will resent with your changes and Ack. Thanks! Alex > >> 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