Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp781863pxb; Tue, 12 Apr 2022 13:18:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRzccQtPqmbga44x2K0Oe1IliKD91hxt/oJ0SdDh5MBRuoDjzkYCtdg/lQj68IkIjmcRTe X-Received: by 2002:a17:90b:789:b0:1bc:293c:1445 with SMTP id l9-20020a17090b078900b001bc293c1445mr6797238pjz.111.1649794711245; Tue, 12 Apr 2022 13:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649794711; cv=none; d=google.com; s=arc-20160816; b=FLWlsmJPljkt2Q81m1OzjAWUhrreb4VEP+0xlK9oXTQ6Ak5TpymckJKfur5aH2mZ9Z WhfhDYoMCShSoF3QruAilN6A4URZVATerqEXg0CarVVxZUkUe3zS7nxg2TVmr2/AKgbw VcqD8l+nH3KTxK7hQBh3leoC4NRtYe4VOZrbtwG0aZn56+lXGgLcInl0y9TOrw8RkFQC +fMgXbWJmRKAEM8DPTtKnMtdKIm3xZUhDbkmfVlri+cNbRpndiIx3vdd6Kw7XP4+EOak sGo2RBt0gyLxRNjSyL+VEZBj51Awl0ZnPxb5XMT+Ln9JhYb+/7AxISFX0zOR51EHHlZo XPLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=cgqggWGHx1f1C1XeWswqg8mL64GYxNTkfGqlo0DUYWY=; b=0zJInNXI6qNPUiLxGcEsuf5nOB4WXMILbsNqS6jDRxAEfwGoKyS5/FOzbl3VDJsoft UL1QtREslUaHimOTqv/m2p9Ofrs6Q3tdl46Bdl2XM0hAXv4QXnci7ZTD5uZJVKxeqBZx LILQYENZyB6FauFSjbN759dP41i6ACvw1brc7X5aZMPuao+i/OfZaZgE27d3O1SjzwJs gUYBywVPmSzDNYCWV0Lkz/5gscOyigYMBZvPeeY4v5aHQ9j8J29ECBRYrEC8c2YU7X5u +1cNcS1XriBGs+eOS6PTMZHdn4PseEE+kAzfBSznhjt5AUs9LkbdSpfy7f4r9SSRRMK0 rsiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Yn2dcjwH; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d11-20020a056a00198b00b004fa7bbf2aefsi7001402pfl.304.2022.04.12.13.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:18:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Yn2dcjwH; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5918D7B563; Tue, 12 Apr 2022 13:01:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347578AbiDLBNI (ORCPT + 99 others); Mon, 11 Apr 2022 21:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351414AbiDLBCE (ORCPT ); Mon, 11 Apr 2022 21:02:04 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67C6313E28 for ; Mon, 11 Apr 2022 17:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649725188; x=1681261188; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=ID7Dlx34WXaq5itFE0ozcc4Gc9FFa/Ra2b7+KNAMdtE=; b=Yn2dcjwHzdBS89SggZQt88MyvDd8EiG3a8Su9GhqFtZq3Q/2pY/3KnHa bcNoU0/N+A3R8rr+A9bMHcQjFCt0v6HKVEf1ereLChWNfQ+gROxpz1KXH 9vh6NMTiGv1KeLfJq7ZcQUJqS+y2LpkCStioUrCR0XBAek89oscU1JGdm E8RAq+85UhqWxrHplIODTEA4JBJcAmomdMadSO9S5fSxlbanrIGV0Y581 BOF2nmrk5iqc/sRToqfrfjWDT1re6+ZgfaLccvYU84L/b2Otw1HhBIdA6 l/tJ48B0MAyYxa1RWHUKzEeS4JKYoDI+xcBh6fsDM1/J/mer4qRMmrQCD Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="348686910" X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="348686910" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 17:59:48 -0700 X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="551469928" Received: from joliu-mobl2.ccr.corp.intel.com ([10.254.214.243]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 17:59:20 -0700 Message-ID: Subject: Re: [PATCH v2 5/9] mm/vmscan: activate swap-backed executable folios after first usage From: "ying.huang@intel.com" To: Miaohe Lin , akpm@linux-foundation.org Cc: songmuchun@bytedance.com, hch@infradead.org, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Tue, 12 Apr 2022 08:59:17 +0800 In-Reply-To: <20220409093500.10329-6-linmiaohe@huawei.com> References: <20220409093500.10329-1-linmiaohe@huawei.com> <20220409093500.10329-6-linmiaohe@huawei.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Sat, 2022-04-09 at 17:34 +0800, Miaohe Lin wrote: > We should activate swap-backed executable folios (e.g. tmpfs) after first > usage so that executable code gets yet better chance to stay in memory. > > Suggested-by: Huang, Ying > Signed-off-by: Miaohe Lin > Cc: Joonsoo Kim Reviewed-by: Huang, Ying Best Regards, Huang, Ying > --- >  mm/vmscan.c | 4 ++-- >  1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 0e5818970998..cc1193e320c2 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1412,9 +1412,9 @@ static enum page_references folio_check_references(struct folio *folio, >   return PAGEREF_ACTIVATE; >   > > > >   /* > - * Activate file-backed executable folios after first usage. > + * Activate executable folios after first usage. >   */ > - if ((vm_flags & VM_EXEC) && !folio_test_swapbacked(folio)) > + if (vm_flags & VM_EXEC) >   return PAGEREF_ACTIVATE; >   > > > >   return PAGEREF_KEEP;