Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1677087pxb; Wed, 9 Feb 2022 01:57:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzjcHmhOXrb+/Dw59yk5FtaWZvDUf4nnnG8Y38RsbE8g21jtXxEm6OxXbwa0mAL1oDNs0b X-Received: by 2002:a65:62d7:: with SMTP id m23mr1207689pgv.329.1644400631192; Wed, 09 Feb 2022 01:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644400631; cv=none; d=google.com; s=arc-20160816; b=O+IGhcKnMVToaTXBKelIuY5qRfWYBJsMsekimAv+Rl9dfie6qclaJahhw7pwk41lLY udX746YV+SSEfHzk2W8lTD2TgUHfVOLLJfJCDm7YXtvo38udcCzzOS0cR8OxWWyVDN/t +G6tGpvfzI0F3GCswv6cQ2ENLHkUMhxQ+EGEO/hJqdHaf1qelWvBdMbRHSMtIyfGW00Y JqZxJt0XQCxJoA3gNiOjVqREKLpwNKLgHK6YJOxFroD9jIbn3CVS+z68EkeC2DkPMgiv bQ6V6ENkJBMOeXXW8Eb0UTUHWua6QYj3bXrrjJCfuAUs47VgecO4zt3lbwbP0aZ2xi5H NlQA== 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=IaBXYZ+vat/5ri8bP0Swu84ZGYn0w01tNU9IeoBlMPo=; b=jGROB5Nsa/f5ALuY9Nu7ctCKVeuCeklRqPrR6XVEOLIXK3hmU2YecqIkndWkW3uoqP +BGlmMoel+8u4nq0GPFhPQX2E/5bypj8rNqQHFGngGRWQMHdr21ibMuz9hjqIubQPujV 5jsdK3I6iShAORKiWE87O+Hu4er9skkkWrfsf7k3AV1OcyDfMnJpUBZsg54NcxZCCHi9 9wjB4ndi1HMxI7ieYTgziFwa35dXQMA+JKlS+x5KVqIjnsRSlURJuwgMbpod3CF6CiTc 4arR6lTJ466vhtFSwTUqEJde9iI9uL6DD255zcq/r0/c/K3ESgwBarV04QMRsBr4v/s/ 40hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=JThnxs6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mh13si5604761pjb.155.2022.02.09.01.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:57:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=JThnxs6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A799E049449; Wed, 9 Feb 2022 01:11:05 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349399AbiBHI2l (ORCPT + 99 others); Tue, 8 Feb 2022 03:28:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbiBHI2f (ORCPT ); Tue, 8 Feb 2022 03:28:35 -0500 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCFBCC03FEC0 for ; Tue, 8 Feb 2022 00:28:34 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id c188so20164644iof.6 for ; Tue, 08 Feb 2022 00:28:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IaBXYZ+vat/5ri8bP0Swu84ZGYn0w01tNU9IeoBlMPo=; b=JThnxs6ZEyP2u3Voeo1JuquQn0t749qV+dqgrkX/eEyw4qMNSGPIULygJERycpC1iy +AQd2m1QIjqNSDwOFk46qn5AYDIHYzXVdEM3dtSWuOvlvT8+KthV+E99Rhvtvxn5ILCs haxC3B8Gsf1Pi5Nq/N2zOQ5W0mAhVJkCxyJb4lWDFgta0RejGctd0RcYBY8sIBBL0aWd APCE23snVKHhFdcAW9iyip/mQUSd+NwczXDE1llk0vN/RqI0nPxmqbqcbxTylIaE2XnI bHheeZVK7BT++iatU0uIk/jvo2r77n8slx8g5GX2AeL6By3N4E4LbJMw2D/Drc+Yqdfa sodw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IaBXYZ+vat/5ri8bP0Swu84ZGYn0w01tNU9IeoBlMPo=; b=YIqqEGlkKPW++puqczM0Mo3sF6bbslYfQqSlI1TTI46ggmUlZjqtjGEqXEk0g618mQ WSbG28mZB2y69Lx/asrN/TLngEhts94G50hEAyPvT77qWTX6AzSJ+5TlNtE5O30wO5zX xE9c5t1UWz4bwqHSIvzJ4qoRmMOzw2wKQWGMPZeupQjfIcNsn3wRDC6cTkt962tAU+9s 38P32EE9vQeKTD585iX4Z1pfPKHxVIrxw+yNbH87aCVyPbROzw1/QstaKM5m33OjzURT U4M2MWPvesq50SYzXQkR0Ecnt7PViyNWz0XyCCi+9s9LSn2Reozr8AgywS2TYUcb5627 JlMQ== X-Gm-Message-State: AOAM530iWwD9ZkCVbkVzRC9gAXeZMwEYnluxppHqEdKCSP29xfbVlMYq iEPG7zwlwNbCZ7wTkgDd2dX3JA== X-Received: by 2002:a05:6638:13c8:: with SMTP id i8mr1687217jaj.125.1644308914113; Tue, 08 Feb 2022 00:28:34 -0800 (PST) Received: from google.com ([2620:15c:183:200:5f31:19c3:21f5:7300]) by smtp.gmail.com with ESMTPSA id y9sm2780137ilg.58.2022.02.08.00.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 00:28:33 -0800 (PST) Date: Tue, 8 Feb 2022 01:28:29 -0700 From: Yu Zhao To: Andrew Morton , Johannes Weiner , Mel Gorman , Michal Hocko Cc: Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Michael Larabel , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?iso-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh Subject: Re: [PATCH v7 04/12] mm: multigenerational LRU: groundwork Message-ID: References: <20220208081902.3550911-1-yuzhao@google.com> <20220208081902.3550911-5-yuzhao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220208081902.3550911-5-yuzhao@google.com> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 08, 2022 at 01:18:54AM -0700, Yu Zhao wrote: > diff --git a/mm/memory.c b/mm/memory.c > index a7379196a47e..d27e5f1a2533 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -4754,6 +4754,27 @@ static inline void mm_account_fault(struct pt_regs *regs, > perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); > } > > +#ifdef CONFIG_LRU_GEN > +static void lru_gen_enter_fault(struct vm_area_struct *vma) > +{ > + /* the LRU algorithm doesn't apply to sequential or random reads */ > + current->in_lru_fault = !(vma->vm_flags & (VM_SEQ_READ | VM_RAND_READ)); > +} > + > +static void lru_gen_exit_fault(void) > +{ > + current->in_lru_fault = false; > +} > +#else > +static void lru_gen_enter_fault(struct vm_area_struct *vma) > +{ > +} > + > +static void lru_gen_exit_fault(void) > +{ > +} > +#endif /* CONFIG_LRU_GEN */ Moved task_enter_lru_fault() from mm.h to memory.c as requested here: https://lore.kernel.org/linux-mm/CAHk-=wib5-tUrf2=zYL9hjCqqFykZmTr_-vMAvSo48boCA+-Wg@mail.gmail.com/ Also renamed it to lru_gen_enter_fault().