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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 DC8C5C43464 for ; Fri, 18 Sep 2020 18:54:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2B4B922211 for ; Fri, 18 Sep 2020 18:54:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LkvJaXH+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B4B922211 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 578486B0037; Fri, 18 Sep 2020 14:54:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 502C66B0055; Fri, 18 Sep 2020 14:54:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3CA666B005A; Fri, 18 Sep 2020 14:54:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id 1FA9F6B0037 for ; Fri, 18 Sep 2020 14:54:05 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D15C93625 for ; Fri, 18 Sep 2020 18:54:04 +0000 (UTC) X-FDA: 77277082008.27.fear68_63177112712d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id B6A603D668 for ; Fri, 18 Sep 2020 18:54:04 +0000 (UTC) X-HE-Tag: fear68_63177112712d X-Filterd-Recvd-Size: 6541 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 18:54:04 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id h4so8026782ioe.5 for ; Fri, 18 Sep 2020 11:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UsPKgMSyFpC4dZoU1fh+j1TUaGHxHd0bh9PqbiT/L5U=; b=LkvJaXH+U8mrEYeCNWO2O6kMOoDz/lVdIJf5f58C1MK2fZ4GkvaaL8QNgZTcVMfBfF 73gJtRq4j076mbGAa63E1ULzd92YYRBtcOAxN7f00c1xs1UgIPCxpy49sT6ZV7mqADlM 2XwZY6l5+A9FAnwiCFApQ/A1gMNRycje9HMh/3CCm5NOa7FIcIopFGD/HzxxvRiLhIN9 lIq/f+90PG+yY3bZl5QmkQ+/E1hnXwglFT9YTb79ttaWEiWOFu3pFvAJU/1sObGcXXkt wWzZtd9zOOkddEypESurmueNd9Y5YzVrdSMdZr+n3fzVa8Gvdgb8EotBmgPde/pixweg f9lw== 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=UsPKgMSyFpC4dZoU1fh+j1TUaGHxHd0bh9PqbiT/L5U=; b=nbXYw3gCm1m5m5itQuUrKJn+Cvk865cay5WZqcVPR4ryc7swEsRY9r3dwEI6jlmFo6 73OYVzk9Im4e1I80vpnLtSdncfdAxCNAJe5cqxGxrmJLbIbUCbNIWkf8UgZUltytw7dV Gd4lPF/mw82ulRFh7HYiJkvDt2TqiEKD6uMKl6MF5PYhWTDxFgyPNlhvgkeNvdjGNGjR hrm2xln27rsCm/LTj8ou0cZ+SUU7OvqlVmQ+j23Rbk5eiDYahfFU+q7CaFrO28/4C13j qDNXnEPLhq0wE1sLpZ0Bd32U1k94wdT6d9kR0FYyZGsojtbwk0aZFIWVTbNUVdiSDqx1 pYrg== X-Gm-Message-State: AOAM531T1MQxCa/cbqA5qG9hM5HCmyNhBHdm2RW/f9eWTVH5JuCRwOby yM6um+G1Yj9qJNS0BOqJBMX+ZA== X-Google-Smtp-Source: ABdhPJxHmVEbRNB4JMGgDW9ScAN70Dh87oJ1EB2DOPXrIlbPlDDplv7VfIepqr80Q87AmEKzD/rypQ== X-Received: by 2002:a6b:6d07:: with SMTP id a7mr27628444iod.82.1600455243299; Fri, 18 Sep 2020 11:54:03 -0700 (PDT) Received: from google.com ([2620:15c:183:200:7220:84ff:fe09:2d90]) by smtp.gmail.com with ESMTPSA id c85sm2096858ilg.10.2020.09.18.11.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 11:54:02 -0700 (PDT) Date: Fri, 18 Sep 2020 12:53:58 -0600 From: Yu Zhao To: Michal Hocko Cc: Andrew Morton , Alex Shi , Steven Rostedt , Ingo Molnar , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Shakeel Butt , Chris Down , Yafang Shao , Vlastimil Babka , Huang Ying , Pankaj Gupta , Matthew Wilcox , Konstantin Khlebnikov , Minchan Kim , Jaewon Kim , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/13] mm: use page_off_lru() Message-ID: <20200918185358.GA1095986@google.com> References: <20200918030051.650890-1-yuzhao@google.com> <20200918030051.650890-3-yuzhao@google.com> <20200918073700.GE28827@dhcp22.suse.cz> <20200918102713.GB1004594@google.com> <20200918110914.GK28827@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200918110914.GK28827@dhcp22.suse.cz> 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: On Fri, Sep 18, 2020 at 01:09:14PM +0200, Michal Hocko wrote: > On Fri 18-09-20 04:27:13, Yu Zhao wrote: > > On Fri, Sep 18, 2020 at 09:37:00AM +0200, Michal Hocko wrote: > > > On Thu 17-09-20 21:00:40, Yu Zhao wrote: > > > > This patch replaces the only open-coded __ClearPageActive() with > > > > page_off_lru(). There is no open-coded __ClearPageUnevictable()s. > > > > > > > > Before this patch, we have: > > > > __ClearPageActive() > > > > add_page_to_lru_list() > > > > > > > > After this patch, we have: > > > > page_off_lru() > > > > if PageUnevictable() > > > > __ClearPageUnevictable() > > > > else if PageActive() > > > > __ClearPageActive() > > > > add_page_to_lru_list() > > > > > > > > Checking PageUnevictable() shouldn't be a problem because these two > > > > flags are mutually exclusive. Leaking either will trigger bad_page(). > > > > > > I am sorry but the changelog is really hard to grasp. What are you > > > trying to achieve, why and why it is safe. This should be a general > > > outline for any patch. I have already commented on the previous patch > > > and asked you for the explanation why removing __ClearPageActive from > > > this path is desirable and safe. I have specifically asked to clarify > > > the compound page situation as that is using its oen destructor in the > > > freeing path and that might result in page_off_lru to be not called. > > > > Haven't I explained we are NOT removing __ClearPageActive()? Is my > > notion of the code structure above confusing you? Or 'open-coded' > > could mean different things? > > Please read through my reply carefuly. I am not saying what you are > doing is wrong. I am expressing a lack of justification which is the > case throughout this patch series. You do not explain why we need it and > why reviewers should spend time on this. Because the review is not as > trivial as looking at the diff. I appreciate your time. But if you are looking for some grand justification, I'm afraid I won't be able to give one, because, as it's titled, this is just a series of cleanup patches. My questions above are meant to determine which parts are not clear. Well, I still don't know. So let's try this. What's your impression upon reading the first sentence of this patch? > > > > This patch replaces the only open-coded __ClearPageActive() with > > > > page_off_lru(). Here is how I would think when I read it (which is purely subjective since I wrote it): 'replaces the only (an outlier) open-coded (bad) with page_off_lru() (the norm)' It seems to me it has everything I need to know (or say). Of course I could spell them all out for you if that's how you'd prefer. And if it's not enough, then please show me some examples and I'll study them carefully and try my best to follow them.