From patchwork Tue Jan 3 19:13:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 38618 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4779262wrt; Tue, 3 Jan 2023 11:20:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtj/DiJc1K4h6phrQLjSipMkAStRTCxJE1XFa0G1TE1+tCoIPwyjUZt/Pl54NuJ4WchtCFB X-Received: by 2002:a17:906:1c59:b0:7bb:af66:f38c with SMTP id l25-20020a1709061c5900b007bbaf66f38cmr38910940ejg.10.1672773659200; Tue, 03 Jan 2023 11:20:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672773659; cv=pass; d=google.com; s=arc-20160816; b=M24p5dkYRE4A8NmNdlAi2Za4+QR7ZSCj81v1khH53NWVAUhmOBzOHohJOplVldmhkn zPq7MsNtY8xMBbbNPiYomcIe9dVfwoOYAh/oB9thBf7hDvU4+n/MenHEqAOMZUU/V0l1 8A1XM91c/h1J4wZ9+/tzaJaTFU4sEStkNMqoTAXSe0My6qaKaVOMBCgWksreKv+/f5tx tFKdNH6el5GKCyq1i9avUl8Qibg3ZTspfusfOyaM7RdyTYQpwAVspmS2bWItNgrKNrSo WGvDCyvZ3Ka8CMCAm9OjZh4RG5cTc5GsXVwcplpZ/Krpo4TDJZy3jI+zHR2TByknlVXm FQxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Q/ely+APh40QA7PIqRoFk6Hlp8rvygpoGpgybXM+zlc=; b=CGmz2BImFxBmqf/lwWuE6yg3L9o6R8a7HTVyrjd1uShcrrwuQw/N4tUjxtokC1PsMV hcnS5WU7PqP8gJLPMFRXASw6/YbIi2Rv81xr+crhNp4gcXudhf61rJtjJtE2HnQX71IH DyL/FDGzf2SgofyZtpY7v6SjzbIVUE3gOC2cqUiMekCvjdHdULk8B+Y4YtpBSlaD8DSx Dwj8OpUOxF9txtc8j0ldq6dbBttevDhf7S4WjRsYN9OosNUvSSDpGoSpZLnJBbx9dEgT 5S/QCa/4LB/p3LMMvxWTaajp4klU2uJUpmzOLbWxE9TGvRLD7gFzEYMRir5gI/oBbqsn UPbQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=wSeRFYur; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FfV9hhUu; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js3-20020a17090797c300b007bd112b2764si28946478ejc.381.2023.01.03.11.20.35; Tue, 03 Jan 2023 11:20:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=wSeRFYur; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FfV9hhUu; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234060AbjACTQf (ORCPT + 99 others); Tue, 3 Jan 2023 14:16:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238923AbjACTPk (ORCPT ); Tue, 3 Jan 2023 14:15:40 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB3214030 for ; Tue, 3 Jan 2023 11:14:28 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303JDrHH000987; Tue, 3 Jan 2023 19:13:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Q/ely+APh40QA7PIqRoFk6Hlp8rvygpoGpgybXM+zlc=; b=wSeRFYurYteDdqZqD4bubFhhzrNE3LSDIew/fnoFzF87LKWa+iOF+4rzkFxJQIJtpIN/ qFfG1FWmy/GcV1fLw9HCFAtRHOAiI7AuZSRNf4U1Wy9Yi9o+kRLlXh1EOESFzum6RxRg +WiR8QzmDiMfuYDHZdrz8BPgnPedZBhrmud1nZrpBCDFpeHncGZU5V6QMlpjUhlanwLo b85cieWo/lBoZeZXyCTRrB8jyoxiShsvRloeoAXi4R+ugFf26F57aAavfaPLgNnt+OnY vrDIc0lbD8SbuPI9cW0WN1emKilLlgdVxrbJghphi2lYrBtfKo7t4rI9V4MbgXUigsRM 6w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mtbgqmxhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jan 2023 19:13:55 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 303IUVKv012246; Tue, 3 Jan 2023 19:13:53 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2171.outbound.protection.outlook.com [104.47.73.171]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mtbh58q0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jan 2023 19:13:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7ri1QMkjy0cQOf06EdA58Rqn7cCczV6yWT3AMrrk9fUqSH3BqA66JAxejUaEtFyh9UU8LfqFomz/7SmPENURVQv/7qUIJRw0/dEnsO7uDYUU5RW1BxNM0assoQRrZIuacol/d7lcLCxT78fw26q3LWJCFevztWalzfoWCicnQt/KHTEYc3K7h/5ZIDxrHyu38Nrt5NopLC6sD8FdwNPXJUQoidZqRDw8jDYnnJz1zt8+FObfaveAhbYIsv2j/hDuRwzY/nDQFKF9XE/2ZWcUW2JbxP8bdIQRfc3gqxiyQwgEf6Z4caTuWUpp2xAwOovPRCPMKoebifkiVnOzjDc4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q/ely+APh40QA7PIqRoFk6Hlp8rvygpoGpgybXM+zlc=; b=Rq4QM9CHrArbcKI2d0WQfYksRsqe1T8xcS6fVMeRfovpf4ZCd1pit8e/whLgzzT2ns48jlGgG5YduP1QI2M2bxjOPqzmgMMAuoPwGFqJV6Igg2fkvOadUGkjL224gJncr28cljQcuh7e6WfQUaZrcjLagTT3iDC7qcuvqCjPujth0tMUdiHVhr27OZ6Vp0hMizHyNZgVAXPmURZYbv5HtcglYdDfByaJbbSKMghyOqCBf3sizLwXhfG863uoyhCecbO/c5Hks9qT63WchLXnTYig0OqXElT1ZYY5KILiOzcobfPf7FyC7R+U8+uz+OjxuYwtoudo+MTE21RHhJr8AA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q/ely+APh40QA7PIqRoFk6Hlp8rvygpoGpgybXM+zlc=; b=FfV9hhUuoKjiZyou9/XNrX96nNorkGh/RlQls8W9imPQSgjBZDrhJjqQoANou9bS+hvCeYf7u+7Pg9ousd6EXoX5aBAfv9qpx3G3nDoORQzjDwNFuv7ZiJKEGm+C9DqrdnFOgPZG6HnjIDsseV6750Tu+NBfESvKxoJiDX6HW0U= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CH3PR10MB7332.namprd10.prod.outlook.com (2603:10b6:610:130::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 3 Jan 2023 19:13:50 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f%9]) with mapi id 15.20.5944.019; Tue, 3 Jan 2023 19:13:50 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, tsahu@linux.ibm.com, jhubbard@nvidia.com, Sidhartha Kumar Subject: [PATCH mm-unstable 4/8] mm/hugetlb: convert alloc_surplus_huge_page() to folios Date: Tue, 3 Jan 2023 13:13:36 -0600 Message-Id: <20230103191340.116536-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230103191340.116536-1-sidhartha.kumar@oracle.com> References: <20230103191340.116536-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH0PR03CA0449.namprd03.prod.outlook.com (2603:10b6:610:10e::25) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CH3PR10MB7332:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a5ed562-826d-4c18-d821-08daedbea59b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pMr49GoZ7BWorU0vfjdPjXH97CT/DdOju/5eOWIQGry/9KHrrjWGqcHUPgYYUveKC2KFYg2/CfEfvjfWOLAA5lQIVd+ztuKf4tOo33/ha76ndRm5Ctqd/YNsDN+vrfk2S433XihLKU7eHgEZM2gcTI99/xNUuJjfD6crhF5zxJY/+YNrV9FZKCozTSdUMk6cjQoJJ5c6yrJofmk8FN5xznNEQEFXeG5SGOI8Ujw4MS8hiEUxfNcM2P2T3aKAUBMO152KFUTlfe6GejloWBAf4dsGMAIyb/UwyB4A7YWdYWgadgDpDmiTtXq1zBJsSAgfNEXzzvj7jGJeLji81Sb5dBF8xo8jcuOwiG4R9TpjvQ2lZyR4fA8tW5Uq+fuU3pUrS5vcN2LDtEOPQbsqM8HHCVxecFBw4HFu+a4wSRzELznNIZQ2Va4EaTvntCqcMyrdr0+slXlxLIMrqoUYhC0I7TIjFnMg0nBq7fWGzf0L6cdciub77elLZD4ejJTgf74dqxIWRTmENyzTan5df9QhhXaMu+9ROn0IES5Sy4IMDbplVJsY3p5UWmQ1uZkrVuCZo4Ly8TEaMFpwIj2tF6kpWHGEc+O4RewlAYQSE02RM6pqrzaoYXBG2UD4jPIc0z+7ldcPdEjnt6Q8659phHXrr/NPaGSChRKz+YBXbKEVZ3xpF0xMkuU/RxYSGR34N/f+Z9yQyuk56xT9QnUg5Q7KkA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199015)(5660300002)(2906002)(44832011)(8936002)(8676002)(4326008)(41300700001)(478600001)(316002)(66476007)(66946007)(66556008)(6486002)(107886003)(26005)(6512007)(6506007)(6666004)(83380400001)(1076003)(186003)(38100700002)(2616005)(86362001)(36756003)(22166006)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ufvHpW/OvHRC7UphAjvaBH6FrpvwjitSPQ4DmgS/5GXDyt//NsAvFjAZCQkW/KirRki2Ta5rf7JgsWPRbhtYbfdwLnUzhwQXBXFkBhWQOQbKeTHK+5y1FQ3fN3cqwqjt6iUo0JoDcCml6V28VBgM6T4q/C9hedCuO0I5RjHXftNZ8jf1KlVCR+5Vh9cpte83CXayxi2atDYZ3C7OElHR9/AUocOKhwk/iQqdhXYB0goazU5oLJ9ydPaUiapNYhqqd+ML7uOAOTM/uItTVzB0oAJQ/QgO/ObEqfgvXb4yKq7UOQvC3SEB/miILnu7dEkw1vMQn4mmRnwxpw6Pk8ebBdI+Ti6lOx7b8NuScpP4EZqVySDwV1aZaBrrUzrVEqWbRmPkL7Pq2YUdAmSg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5K4EoxykaK9AC8DSUDS4IR8dFSeGoj2dvGmtBHJiwssUH959hJd6BelRX0EZjqAE9Ad6754QHu68g/YGoOHSwGO3vqRirNWYqRRz+vGzxPf8CspXuiB0Tru6R8IW+wYCA1ngYTtQjwU+OcGf8Wo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a5ed562-826d-4c18-d821-08daedbea59b X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2023 19:13:50.5775 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xMBz6xhX9YgqnjbGyI0VV/YMk++zS/e/WMgE4CD8tbJfJ6InKq41MpgmeQaHQ9Huv2NzfXbM2bX66JTmNU2h0CByiB4i0EMEIR+ya0ONSXU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7332 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-03_07,2023-01-03_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301030165 X-Proofpoint-GUID: 0sLC0NNNmPn8gAthqaOjsS7y9KAfyFFL X-Proofpoint-ORIG-GUID: 0sLC0NNNmPn8gAthqaOjsS7y9KAfyFFL X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754030312540849144?= X-GMAIL-MSGID: =?utf-8?q?1754030312540849144?= Change alloc_surplus_huge_page() to alloc_surplus_hugetlb_folio() and update its callers. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 8dffb77d3510..0b8bab52bc7e 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2237,8 +2237,8 @@ int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn) /* * Allocates a fresh surplus page from the page allocator. */ -static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, - int nid, nodemask_t *nmask) +static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, + gfp_t gfp_mask, int nid, nodemask_t *nmask) { struct folio *folio = NULL; @@ -2275,7 +2275,7 @@ static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, out_unlock: spin_unlock_irq(&hugetlb_lock); - return &folio->page; + return folio; } static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, @@ -2308,7 +2308,7 @@ static struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, struct vm_area_struct *vma, unsigned long addr) { - struct page *page = NULL; + struct folio *folio = NULL; struct mempolicy *mpol; gfp_t gfp_mask = htlb_alloc_mask(h); int nid; @@ -2319,16 +2319,16 @@ struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, gfp_t gfp = gfp_mask | __GFP_NOWARN; gfp &= ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL); - page = alloc_surplus_huge_page(h, gfp, nid, nodemask); + folio = alloc_surplus_hugetlb_folio(h, gfp, nid, nodemask); /* Fallback to all nodes if page==NULL */ nodemask = NULL; } - if (!page) - page = alloc_surplus_huge_page(h, gfp_mask, nid, nodemask); + if (!folio) + folio = alloc_surplus_hugetlb_folio(h, gfp_mask, nid, nodemask); mpol_cond_put(mpol); - return page; + return &folio->page; } /* page migration callback function */ @@ -2377,6 +2377,7 @@ static int gather_surplus_pages(struct hstate *h, long delta) __must_hold(&hugetlb_lock) { LIST_HEAD(surplus_list); + struct folio *folio; struct page *page, *tmp; int ret; long i; @@ -2396,13 +2397,13 @@ static int gather_surplus_pages(struct hstate *h, long delta) retry: spin_unlock_irq(&hugetlb_lock); for (i = 0; i < needed; i++) { - page = alloc_surplus_huge_page(h, htlb_alloc_mask(h), + folio = alloc_surplus_hugetlb_folio(h, htlb_alloc_mask(h), NUMA_NO_NODE, NULL); - if (!page) { + if (!folio) { alloc_ok = false; break; } - list_add(&page->lru, &surplus_list); + list_add(&folio->lru, &surplus_list); cond_resched(); } allocated += i; @@ -3355,7 +3356,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * First take pages out of surplus state. Then make up the * remaining difference by allocating fresh huge pages. * - * We might race with alloc_surplus_huge_page() here and be unable + * We might race with alloc_surplus_hugetlb_folio() here and be unable * to convert a surplus huge page to a normal huge page. That is * not critical, though, it just means the overall size of the * pool might be one hugepage larger than it needs to be, but @@ -3398,7 +3399,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * By placing pages into the surplus state independent of the * overcommit value, we are allowing the surplus pool size to * exceed overcommit. There are few sane options here. Since - * alloc_surplus_huge_page() is checking the global counter, + * alloc_surplus_hugetlb_folio() is checking the global counter, * though, we'll note that we're not allowed to exceed surplus * and won't grow the pool anywhere else. Not until one of the * sysctls are changed, or the surplus pages go out of use.