From patchwork Wed Jul 21 23:05:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 12392477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78EF7C6377A for ; Wed, 21 Jul 2021 23:05:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1E6A06121E for ; Wed, 21 Jul 2021 23:05:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E6A06121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A3B426B0075; Wed, 21 Jul 2021 19:05:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9746C6B0078; Wed, 21 Jul 2021 19:05:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DCCE6B007B; Wed, 21 Jul 2021 19:05:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 458776B0075 for ; Wed, 21 Jul 2021 19:05:41 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F19E61844C6AB for ; Wed, 21 Jul 2021 23:05:40 +0000 (UTC) X-FDA: 78388128840.02.0C8A838 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 5C0FA802BE31 for ; Wed, 21 Jul 2021 23:05:40 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16LMvacR031904; Wed, 21 Jul 2021 23:05:35 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-2021-07-09; bh=T7aTzh/od8/z0na96515K7P39K5dkQ+t5If8qBwYzOo=; b=l2DgWEUGsDftZi2+AvHeAXZ0GlFmkXdr7x2qivj9sFrKGbQTEEzSkx5QxFwIcKJ1Pd2u iIbVeYYwWpFXiwlBl1lTD6HbctyggALYr9X71KxRmE/qZztSWZmgEhqh3uVIjCDu820P XNcswRvdv2f+jgJLngnWTd73l80AXkk+Rh40Hfip1FfZxGNuyXgjv174/7NPcaUe29Zp N8fOqh2r9dYt+4KdjPUHdQdvnb3Q9k+6ciaRaPfVgSejKJisPZJDqDwtsb7J+4okf9dD FyAUCW0v/HFzI3uS07W4iRMfOmy0oQb7JVcalB2sED4SRIh9IMO9G5VPDN5LYo6kW8U2 TQ== 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-2020-01-29; bh=T7aTzh/od8/z0na96515K7P39K5dkQ+t5If8qBwYzOo=; b=y2B8ZyqN2z2z+Bx72kQc2gowmGMMUmnGWGKvWKtcw+1vFR+4Nbrf/2/SyfuTmJEputNo MA8dzUesXd7IP7yOHKpKXFYMyyNkT2lFFJwsyEivJqnz0MnM3mIKcytYOq+uhRVxBHVl GKLZLamgvyXJitC3CioEJKrhxZGSM3wqRtfPL0SJVNEjnvn/fUQfz3mRSleA+y6Xrw5B /4lad5cmFJ6EZeGMUt/LzTUAPcYsMbIxWlY/VBAGxKsifmZKmB9yRqSD/pDs1Xs1kjl1 8nrH7rlRQvMs4zQG2rQWm/MMl+M+pGFeQrD55DkdYoiHaf+MZd4BnccMeOysLKwI/ZYM PA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39wwmtuxqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Jul 2021 23:05:35 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16LN5OwM103297; Wed, 21 Jul 2021 23:05:34 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2047.outbound.protection.outlook.com [104.47.73.47]) by aserp3030.oracle.com with ESMTP id 39wunmv2mm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Jul 2021 23:05:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dk6LEmq6skipAO7lyZPV3T15RcBrOAEifWI4QN+POSMklnp1b98FGmoTKgSYSag7+awa6IX691h0CxKILJCUbggR8DBMWnoio4Hn77kSVlPwns6z80rZKq8pUN63f3EFeK1fCWBd4hMkhwsOLoJaSlgSzBbwOy7/SYG0Kdi4puogtm99l3jj18IDKGdAkxbHzfbmZ2wgekNpNELmQIzPCzibZfy55CQS12GFJG+cmidSMrOP5DXRwjD8zNETnh+MduTOWw+i2jfvISBqwsgRm7+dks+wMi6Epx47CD8Rvm+aHiS1NUWc0L9yxocOmqM+ZRrS0/r/hDmVmulmieFBPw== 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-SenderADCheck; bh=T7aTzh/od8/z0na96515K7P39K5dkQ+t5If8qBwYzOo=; b=MajbTL3/NBPKqR0u9+SZwWXB64bFBLp4vvdBcQFR/kfQECxjEgb1xwSeD1q56hEJlKGeHIF4rRbNSKyVK4M3zrm81UTIIyfg16ClkNdQ0ADslmVlXhE2Y1XIydHiTjL8N3HzAly9Q9JbdQ4p0GzzyHx1BzMYNxoXPE60344L9voY3bKzfyVM41K+s1+14IvH7+nQXEF9PsInFdTqOfJPJRXsLjdEdNIRgmv6MwSceZau20zDOGrU0q/5Q50VhhforRXOgPZ2cwXYYIOUJzgNCTP6NseJt45fsV6VcobZlgZk6EcNYpEgRNF7YiBnd0LgTcrtCrcsmDhfravJL/Ereg== 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=T7aTzh/od8/z0na96515K7P39K5dkQ+t5If8qBwYzOo=; b=T+K+dX3+OMjox3JWLan0iaN3YS/B6TI44IX+wXSbrxm7ttXcu2zcPfzGmJbTSDZTYupPdtBdH8iOhcezI2k53CXbNzfgeN+7Y6LPqM1oTGMsF06GP6gRZjeM9fn0GtGvAsbXpmTMLlnhNgb+CsT6fy7+ok/6EW3ahfkuD74wqXU= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by BYAPR10MB3735.namprd10.prod.outlook.com (2603:10b6:a03:11e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Wed, 21 Jul 2021 23:05:32 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::8d2a:558d:ab4a:9c2a]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::8d2a:558d:ab4a:9c2a%5]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 23:05:32 +0000 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: David Hildenbrand , Michal Hocko , Oscar Salvador , Zi Yan , Muchun Song , Naoya Horiguchi , David Rientjes , Andrew Morton , Mike Kravetz Subject: [PATCH 5/8] hugetlb: document the demote sysfs interfaces Date: Wed, 21 Jul 2021 16:05:08 -0700 Message-Id: <20210721230511.201823-6-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210721230511.201823-1-mike.kravetz@oracle.com> References: <20210721230511.201823-1-mike.kravetz@oracle.com> X-ClientProxiedBy: MWHPR1201CA0021.namprd12.prod.outlook.com (2603:10b6:301:4a::31) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from monkey.oracle.com (50.38.35.18) by MWHPR1201CA0021.namprd12.prod.outlook.com (2603:10b6:301:4a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22 via Frontend Transport; Wed, 21 Jul 2021 23:05:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91539aab-2700-47df-b3ac-08d94c9c0a4b X-MS-TrafficTypeDiagnostic: BYAPR10MB3735: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CWrHud3LUDXWF5QOGbZkp2ega3iSG7YPU/edzIA0TQOinnDUdAG+jzKAGY+ZxjWEi7qmKyyYUdzJVdL/b+gC0lEMZuqv8xVS8Kcaj9S+ZWnHYv5Q/6Xlw5ZdhvUF1/SEjOp/msoFcn29JpdOFZFuvRWtpWROZg9ZnfeVa2zsqhMzeJwMppAxkdDEJXflGFgaoNSv8JWx5nCjpjj4yIHK5q+8kfVOFEBkP1YI98eosya+0AUgLJqgLedFHSLA/oZcoBYiuZPPCzNbbNrCFCwYMQts5ffCiMA441eeDiiPDZ/82HayyQgFlr0RzQC4vjdGgDLaeJZp4KD+ocIJBQIrzP9CDIXKEYtmUUWM+1gJBxoPOqWawGzKY3v9p4dnLVBZTVe/ioZo2lpBGroEhw1KcvhDs4iqJ9NF5J4xhyhqQC/M8kGuJkra9ssMQvDYCY3SgQeo34l0P0QBj6gMMJiuBbLnvRFCCNfu3Y42Th/X7e8XPbQLgRjZxqI3LJfdISphozWLNzoQtr5ifDh2J8xucmSblZGb4GSXBFwLEkexcuQBOWJWtYIqgNbQ49YPLWe9gDda89TqVzY6bDBtNee7P+NR7OmhOwt3QXR+xJ6jvR82+k2wK+c7rbKlMhq245c79zTXKWsR1TkHdMu+mtzO1Bh0r8Yj3lZBd8lQiZ2yQ4yMITfENwvOXFVBqnviC5izDJJz4eGFNKwGo4mEqcYVcQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(366004)(39860400002)(396003)(136003)(376002)(186003)(66556008)(478600001)(52116002)(86362001)(2616005)(107886003)(8936002)(5660300002)(1076003)(4326008)(6486002)(2906002)(66946007)(66476007)(956004)(6666004)(26005)(316002)(38350700002)(38100700002)(7416002)(36756003)(83380400001)(7696005)(54906003)(8676002)(44832011);DIR:OUT;SFP:1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ZxfNjJLgML+v2Gei9NGkgcVj/DdWVqYm7tBkORV17He6BgNDY5R0Pb3talYh5QlLc8kW5UY/bmaLsF69H/O41byMvjywKQAVJAWCBzJyC0yTctt5HUI1uWLGnIDJYRkH0IYaLY3Jm3mqxUneby/BE9T6GZEZJy89QzWOSN9QzaKX5Bvv80uIJuYJKVKgYxqVtjKdLIK5/EHrHMQ+4LQynv4l28CgOkfdT3W6/v6JxiIe57EMOwOlxOcSeTlNxw9vffVyiUbCHhiV11BbtH+ugri7AH/CSqn7CiJkwlw+Um/8l5RGglcz8ChFe2BcI5wyz2B/TEI5KLv X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91539aab-2700-47df-b3ac-08d94c9c0a4b X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 23:05:32.3004 (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: ZLzxgg6XlU+8LOF+Pgt5O/YfY/IjLWZsU6l99c/fK8l83wvVvZNSNlfyueb7crODUHrw+JZpmpLE8I26U0T3AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3735 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10052 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107210138 X-Proofpoint-ORIG-GUID: IAT_FspoB-uF-p2PsaCpeUZfGz5AJhnP X-Proofpoint-GUID: IAT_FspoB-uF-p2PsaCpeUZfGz5AJhnP Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=l2DgWEUG; dkim=pass header.d=oracle.com header.s=corp-2020-01-29 header.b=y2B8ZyqN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=T+K+dX3+; spf=none (imf06.hostedemail.com: domain of mike.kravetz@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=mike.kravetz@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Rspamd-Server: rspam05 X-Stat-Signature: j8wdoeq5rytcg18d15ntgof346nq57od X-Rspamd-Queue-Id: 5C0FA802BE31 X-HE-Tag: 1626908740-662982 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: Describe demote and demote_size interfaces. Signed-off-by: Mike Kravetz --- Documentation/admin-guide/mm/hugetlbpage.rst | 29 ++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/mm/hugetlbpage.rst b/Documentation/admin-guide/mm/hugetlbpage.rst index 8abaeb144e44..902059a0257b 100644 --- a/Documentation/admin-guide/mm/hugetlbpage.rst +++ b/Documentation/admin-guide/mm/hugetlbpage.rst @@ -234,8 +234,12 @@ will exist, of the form:: hugepages-${size}kB -Inside each of these directories, the same set of files will exist:: +Inside each of these directories, the set of files contained in ``/proc`` +will exist. In addition, two additional interfaces for demoting huge +pages will exist:: + demote + demote_size nr_hugepages nr_hugepages_mempolicy nr_overcommit_hugepages @@ -243,7 +247,28 @@ Inside each of these directories, the same set of files will exist:: resv_hugepages surplus_hugepages -which function as described above for the default huge page-sized case. +The demote interfaces provide the ability to split a huge page into +smaller huge pages. For example, the x86 architecture supports both +1GB and 2MB huge pages sizes. A 1GB huge page can be split into 512 +2MB huge pages. The demote interfaces are: + +demote_size + is the size of demoted pages. When a page is demoted a corresponding + number of huge pages of demote_size will be created. For huge pages + of the smallest supported size (2MB on x86), demote_size will be the + system page size (PAGE_SIZE). If demote_size is the system page size + then demoting a page will simply free the huge page. demote_size is + a read only interface. + +demote + is used to demote a number of huge pages. A user with root privileges + can write to this file. It may not be possible to demote the + requested number of huge pages. To determine how many pages were + actually demoted, compare the value of nr_hugepages before and after + writing to the demote interface. demote is a write only interface. + +The interfaces which are the same as in ``/proc`` function as described +above for the default huge page-sized case. .. _mem_policy_and_hp_alloc: