Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp458946pxb; Wed, 27 Jan 2021 11:58:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNDGlXTFIv9iGl7rrExxB8kA6Crb9HdZkKZ+d66qciFZnbVq6T1Zkpto/Z9L634Sd1WHA2 X-Received: by 2002:a17:906:7f98:: with SMTP id f24mr7884169ejr.75.1611777527333; Wed, 27 Jan 2021 11:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611777527; cv=none; d=google.com; s=arc-20160816; b=cwZcX0jkYULZnvFuVyFa9KjfVmopm08Js7UsfxtHW6n81YbCUnYCfrwERgOqIR58wf TEaLZFLE2+DcCcl6brW5WPEZRROwKfFitFfT6kO1fkYy6353yjJQTjPySR9bzjceJ3+E LdovpqlZBZ9yBDHRGrPggOCoMFLumGc3Q1Brk7uODq+BR9HTulBUu/g7lzuQrRxEVYdJ nvR95Jdqz9ITJvvxapn+RCEtuRq/27owfjeCmHmY3OMR+0cqPd8S4Rd2QRKdul8HdZjQ u7mHfZHIyC5SVyLbwJEr5tSmoTido26GIUZGgloyvF/Lacupl6irJ1Sjm+Jq0+Ml1/Am h/8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ekn1N2bwuzZRoWAtKJs99FQ8E0MbiDKLziersW7caRE=; b=B04K3GiWvX8oTQ8wSU3KjwLB5JFgCbKFmsB7anWPJnUvHysCop6HY9gBxkqpu9CK92 9LLewuXFKCbQhwwMIbQE3ax4eYaXO6yULcIrW9Dg+xQIIYcF98xricGt9+vu8C8F7IDF 0b4trGuYC2vRhgzWutZysurkmcY1Fh8tDhMDPb2VZngtcFcynJn5ZyxOIfuBiJpO6DTP bpVcab0le+Mms9Srsf1tayxHtUb0FZFghiq18z9io0uX4FPWMt0qUB4TKu+OVf4/u2d6 KR/ESWTWv4EKYyHbdGe8K57xf6ohAKlPoOZa+VwmV1vShAGV47I37ZshFZ6KfdsW8RQI IzLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IVxDhTJu; 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 i1si1287319ejb.687.2021.01.27.11.58.22; Wed, 27 Jan 2021 11:58:47 -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=IVxDhTJu; 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 S236794AbhA0DmO (ORCPT + 99 others); Tue, 26 Jan 2021 22:42:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728373AbhAZWP0 (ORCPT ); Tue, 26 Jan 2021 17:15:26 -0500 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6D5C061573 for ; Tue, 26 Jan 2021 14:14:43 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id u17so37054504iow.1 for ; Tue, 26 Jan 2021 14:14:43 -0800 (PST) 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=Ekn1N2bwuzZRoWAtKJs99FQ8E0MbiDKLziersW7caRE=; b=IVxDhTJujLfkfoIIHKc5PJhCnxU1zxb6K0BO2zVXx3XO2okWVsdslArZoUQ/Bs3yFl 6RS2cJemdD1ghGFEvfhtopOsBrcSQld/kZQ5U29amm+fUc4KihggM+sNuwH8+bF0neHi mzmTnTV9tUz+N/WtcT5IaAm3S9619FGUvdyQdn7w/8QfYhYAnf9maE/fdwqlDFoYpmjM uvW1vYLZZfzVCQBUXpf34KAVPNjYJNJTDXDgaAhFAdicE3YE8uT9V8Aztn+YPawfHaeP wt8f8ImLqz2aILOjIB/YSeWgvQATSGm/iOKAXoyK69R7JhXmPkjiMlwlghLvMKUYjaWj 6u6w== 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=Ekn1N2bwuzZRoWAtKJs99FQ8E0MbiDKLziersW7caRE=; b=GS1lda7QdUi24YpYqdmZeMyK3+tVzoCMlJded48VgudX32MjBviWjVCjFGlX5wxSXP R1RUta6eNe95JJsBLrrf0oboR//CWlhqHoABP+YlhLhlBYUhNc26DP0fuIWRV/iUVaeU bs6zuNF0Ed2OUdW6cKyjauSOQcZ5aIrFBP0Bm9+rHebAapGm5dKes49tBbdUF+zc0nEY E8wn71OgLMyvmHmg56HWH8/J7KNDXHTNIQqrZgGPSU+zvPcr9FUtEje+RTDdK9nGEATh 9yIdmBdlAEaTTuP/yiQ5cqzkrCH6vyBeeS0TX1tJF6de2nRPhiA6xQ/zkOPeYGJbA4hQ Wpdg== X-Gm-Message-State: AOAM530CazTnvqWyGEyXD95ktJ0je5k4X2ONYoW6wHyp/byzwSpa+yaG 3BKP+3PzKj42uad8U7CkIlxPmg== X-Received: by 2002:a05:6e02:1b8b:: with SMTP id h11mr6409894ili.32.1611699282533; Tue, 26 Jan 2021 14:14:42 -0800 (PST) Received: from google.com ([2620:15c:183:200:697e:4b38:5872:adfe]) by smtp.gmail.com with ESMTPSA id e9sm13859463ilc.73.2021.01.26.14.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 14:14:41 -0800 (PST) Date: Tue, 26 Jan 2021 15:14:38 -0700 From: Yu Zhao To: Matthew Wilcox Cc: Andrew Morton , Hugh Dickins , Alex Shi , Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 03/10] mm: don't pass "enum lru_list" to lru list addition functions Message-ID: References: <20210122220600.906146-1-yuzhao@google.com> <20210122220600.906146-4-yuzhao@google.com> <20210126220111.GO308988@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210126220111.GO308988@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 10:01:11PM +0000, Matthew Wilcox wrote: > On Fri, Jan 22, 2021 at 03:05:53PM -0700, Yu Zhao wrote: > > +++ b/mm/swap.c > > @@ -231,7 +231,7 @@ static void pagevec_move_tail_fn(struct page *page, struct lruvec *lruvec) > > if (!PageUnevictable(page)) { > > del_page_from_lru_list(page, lruvec, page_lru(page)); > > ClearPageActive(page); > > - add_page_to_lru_list_tail(page, lruvec, page_lru(page)); > > + add_page_to_lru_list_tail(page, lruvec); > > __count_vm_events(PGROTATED, thp_nr_pages(page)); > > } > > Is it profitable to do ... > > - del_page_from_lru_list(page, lruvec, page_lru(page)); > + enum lru_list lru = page_lru(page); > + del_page_from_lru_list(page, lruvec, lru); > ClearPageActive(page); > - add_page_to_lru_list_tail(page, lruvec, page_lru(page)); > + lru &= ~LRU_ACTIVE; > + add_page_to_lru_list_tail(page, lruvec, lru); Ok, now we want to trade readability for size. Sure, I'll see how much we could squeeze.