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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F312C433EF for ; Thu, 12 May 2022 20:03:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D8366B0078; Thu, 12 May 2022 16:03:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 186918D0006; Thu, 12 May 2022 16:03:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0286D6B007D; Thu, 12 May 2022 16:03:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EA90D6B0078 for ; Thu, 12 May 2022 16:03:09 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id C7C3312071F for ; Thu, 12 May 2022 20:03:09 +0000 (UTC) X-FDA: 79458164898.24.4BAF77E Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf26.hostedemail.com (Postfix) with ESMTP id 7334E1400B8 for ; Thu, 12 May 2022 20:03:06 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id i24so5771735pfa.7 for ; Thu, 12 May 2022 13:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=p6B1aAsZfjrkS+1t6WxdGDpouEQOettYOGKilrJBd8A=; b=FouVjcmQ+ktFXWUIFeG1mpk5zG3tRWg7m8swWBfWEaa/Vr0Rnkk/seZ5nGbo9ItEpV VD5ovAuf6+CJ6U7EyWxWbNPtNgtR/QCSv7keBeHB0Rvxm+hfJISpyGuvwb3foguXLo8r I+hytzL2RW8l6enlgwZ2V4T1Jd4k0lDex5F8yWXeAYCiARddqMPU5N1yahdMjMVWoOJh KpwfTmXEDXDz7nI2bLswySWFqwLBOpKTctHu16cLdRHCUJJvYfpI0Q/QorkQ7hN6jzLq MWOs4Wuz6mVXYXFIU8u/kEA6ygRTINEF6J/q2BZ3BiXcFxzWbrCal/KRr5+z60423NDW tQ/g== 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:in-reply-to:message-id :references:mime-version; bh=p6B1aAsZfjrkS+1t6WxdGDpouEQOettYOGKilrJBd8A=; b=ukfXc/Iye/Bp7rd1ASnzs/k+a1MJvmt/x0Ab1e7KRzczRwo7WRtHv2L3P2qvrA/YFy EfqfIQReAuZdpNuAbJ/XNnZGok9SC5zo8DILuK7vQpZk5Ee7mdDlkvxD9tOce1Y8LDMN XXx+VDqjduB7RpU0WTwkhpopYEqvVaF6lnfJ15Ohx2RxRBSmsSoQa7ZCamJHoZ+PfUfR jAzweAHYN/eR1N3nMqFOmWlhp3geXwvH5UUGHd4v1jwg0vS9GD4hsfFsIUXTOChcvTF9 nDaIHYD82lxfCyv2TuCfSw2npUh0jTIVQphV+yzojTYfn+gGFXBi1dsWqqCCXkIOjjB9 VrYA== X-Gm-Message-State: AOAM530p4+gttF+KtXxPIrIM9aY//UjvGpPSwhrj88gr7rUmU9rFj3UA amxM/IAWUl4LMTUM+R/T2WnEmw== X-Google-Smtp-Source: ABdhPJwkLuV3JThvs983R31py1kP0LE0XnKb0dXHXcr6083evTTtMkNcBM9I9cBGDIN822jtsP3f2w== X-Received: by 2002:a05:6a00:4385:b0:510:4422:aa3a with SMTP id bt5-20020a056a00438500b005104422aa3amr1087238pfb.16.1652385788177; Thu, 12 May 2022 13:03:08 -0700 (PDT) Received: from [2620:15c:29:204:8122:ccb0:c783:c757] ([2620:15c:29:204:8122:ccb0:c783:c757]) by smtp.gmail.com with ESMTPSA id y63-20020a623242000000b0050dc76281cdsm198659pfy.167.2022.05.12.13.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 13:03:07 -0700 (PDT) Date: Thu, 12 May 2022 13:03:07 -0700 (PDT) From: David Rientjes To: Zach O'Keefe cc: Alex Shi , David Hildenbrand , Matthew Wilcox , Michal Hocko , Pasha Tatashin , Peter Xu , SeongJae Park , Song Liu , Vlastimil Babka , Yang Shi , Zi Yan , linux-mm@kvack.org, Andrea Arcangeli , Andrew Morton , Arnd Bergmann , Axel Rasmussen , Chris Kennelly , Chris Zankel , Helge Deller , Hugh Dickins , Ivan Kokshaysky , "James E.J. Bottomley" , Jens Axboe , "Kirill A. Shutemov" , Matt Turner , Max Filippov , Miaohe Lin , Minchan Kim , Patrick Xia , Pavel Begunkov , Thomas Bogendoerfer Subject: Re: [PATCH v5 07/13] mm/khugepaged: add flag to ignore page young/referenced requirement In-Reply-To: <20220504214437.2850685-8-zokeefe@google.com> Message-ID: <6f5fb43c-43c1-596f-77d1-7b314a25c6a5@google.com> References: <20220504214437.2850685-1-zokeefe@google.com> <20220504214437.2850685-8-zokeefe@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Stat-Signature: ptsonziqpxyr956gbgxyaoe6h3eoomi1 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=FouVjcmQ; spf=pass (imf26.hostedemail.com: domain of rientjes@google.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 7334E1400B8 X-HE-Tag: 1652385786-587474 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 Wed, 4 May 2022, Zach O'Keefe wrote: > Add enforce_young flag to struct collapse_control that allows context to > ignore requirement that some pages in region being collapsed be young or > referenced. Set this flag in khugepaged collapse context to preserve > existing khugepaged behavior. > > This flag will be used (unset) when introducing madvise collapse > context since here, the user presumably has reason to believe the > collapse will be beneficial and khugepaged heuristics shouldn't tell > the user they are wrong. > > Signed-off-by: Zach O'Keefe > --- > mm/khugepaged.c | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > index ca730aec0e3e..b14807b7002e 100644 > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -90,6 +90,9 @@ struct collapse_control { > /* Respect khugepaged_max_ptes_[none|swap|shared] */ > bool enforce_pte_scan_limits; > > + /* Require memory to be young */ > + bool enforce_young; > + > /* Num pages scanned per node */ > int node_load[MAX_NUMNODES]; > Small nit: is it possible to unify these into a single bool khugepaged flag? Either way: Acked-by: David Rientjes