From patchwork Fri Jul 20 18:13:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10538147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F63D6029B for ; Fri, 20 Jul 2018 18:14:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C57228708 for ; Fri, 20 Jul 2018 18:14:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D54A291F0; Fri, 20 Jul 2018 18:14:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 135CD28708 for ; Fri, 20 Jul 2018 18:14:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2E3F6B0003; Fri, 20 Jul 2018 14:14:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BDCF36B0005; Fri, 20 Jul 2018 14:14:03 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7F9F6B0006; Fri, 20 Jul 2018 14:14:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f69.google.com (mail-pl0-f69.google.com [209.85.160.69]) by kanga.kvack.org (Postfix) with ESMTP id 612426B0003 for ; Fri, 20 Jul 2018 14:14:03 -0400 (EDT) Received: by mail-pl0-f69.google.com with SMTP id w1-v6so7912204plq.8 for ; Fri, 20 Jul 2018 11:14:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=rqpIaWKppBJ8YebzrMyaxjZuFvfor8gcdMIFLnr3dL0=; b=JvbAddSBKMhheI8OxMSZACNlFanXOC0cUzx8YruWg9X9dkqB2ZAByFCwbBbk8MHqha doUyL+EOtR0FEvVtEZ/4zkEc7lO5sR8dWFHXdfqztTFk+If5s5mJcEGFjYPY11sr4mH+ tGMYxTrpQWZJ3dzDmlusCb9w4ECbOkWIvYj7r6NteGPYN4Whev3XPL6BMcVlsjQrewRf lmwSXcpNPV2KF4eC8O89frkCGcHyGx+IDT7f8K6atWrkYAvjFHh9hPMHC+qppQv3WtE7 rmBTo4asd6z5mNZB38kqdFxa/7OVxZWcdo+ItcscR5lht400IJ4d1AJOpGk1qRBfLpH+ r2ZA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: AOUpUlFoDZ3YYLpDKZ5MBOx8W8r4B0eiZ9sp10MY6jGpbClQQGDmc+D9 /Ki29Ihsa5WRNoKSezq/oYGLvQ4CGfrqNxQvPsmb1Z+X65u1TlNNiwCZzQTcF1Vei82vAEwnDUx /GR8L80sZWh5oSEEPIXfTay1FMSGR6MblFTqBYKhNTYa67uUPPsV22j1lOutZYyYHZg== X-Received: by 2002:a62:c410:: with SMTP id y16-v6mr3172042pff.161.1532110443048; Fri, 20 Jul 2018 11:14:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcagUGlh4rLT2/2a1gmCLGojbxaJuTcXzwBCvwcd+PbDhm9Uj5YqhqyBgnV32EaUcZq7KaM X-Received: by 2002:a62:c410:: with SMTP id y16-v6mr3172000pff.161.1532110442259; Fri, 20 Jul 2018 11:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532110442; cv=none; d=google.com; s=arc-20160816; b=MLT25a5kJGMYrw8gV/tRsre55xffe/l6cu2AMARJDwTNxRE3xIMSNHPLulG8DoE046 LUrmM0zKUO+PsuWmdrYfmUu3R4jvMGSpgJvZPaP82wEYSre+Q1/kIB3oelJChtbi3PQA gTUqeRPy2a8AUGBSR0JgBwwQq5b6Tv8ehd1RKT0xwvItRiECdyBuzn2ClseUIZsw8mkT o9svxlaxgymfEFM6r+4pPofmfVuXphLV8ySTLc21SQsBN1hopNSnbHJ93j402mhVSTG9 3AMZqdsE/7VWp5t2pl5v1dIGktZ9wtSnU9i++kYs9myzY4zmyQPopPQqUGBO1md9TvEi Y7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=rqpIaWKppBJ8YebzrMyaxjZuFvfor8gcdMIFLnr3dL0=; b=kYsOg50MIDSpggEaByLgAvGSA8OGGgTuiGlM/60yytr4TaHlR3tV2LUlD1MITy41Ad fIQZhvb9rUeHDZvdQKqRqcKFT42nLprGRetPe9WxbXuB5qA/9eUgQQFZP58i9oiOo+JX BzKbzP9Ix7DJphxRHEhL9B6D2zpoZG40qn4p7+KSG3Lalod3dmcoG7Y/aFw4SKDSsfEQ fJLAa0Gf0WXRR9Am73XO4Az8ZYn0og0i3ObKZV0eqN6arqluXqRzueGxIMA+v7uBUGEK vFF4TfxJZjx4pBRFgtDJsa9SNFzSJ2iZFobBcPVnEg7K41GUZaIquU6wCv8n63r9hsUt CKdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com. [115.124.30.130]) by mx.google.com with ESMTPS id k7-v6si2408464pfb.309.2018.07.20.11.14.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 11:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) client-ip=115.124.30.130; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R541e4; CH=green; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e07417; MF=yang.shi@linux.alibaba.com; NM=1; PH=DS; RN=8; SR=0; TI=SMTPD_---0T50UBOI_1532110430; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T50UBOI_1532110430) by smtp.aliyun-inc.com(127.0.0.1); Sat, 21 Jul 2018 02:13:58 +0800 From: Yang Shi To: kirill@shutemov.name, hughd@google.com, rientjes@google.com, aaron.lu@intel.com, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: thp: remove use_zero_page sysfs knob Date: Sat, 21 Jul 2018 02:13:50 +0800 Message-Id: <1532110430-115278-1-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 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: X-Virus-Scanned: ClamAV using ClamSMTP By digging into the original review, it looks use_zero_page sysfs knob was added to help ease-of-testing and give user a way to mitigate refcounting overhead. It has been a few years since the knob was added at the first place, I think we are confident that it is stable enough. And, since commit 6fcb52a56ff60 ("thp: reduce usage of huge zero page's atomic counter"), it looks refcounting overhead has been reduced significantly. Other than the above, the value of the knob is always 1 (enabled by default), I'm supposed very few people turn it off by default. So, it sounds not worth to still keep this knob around. Cc: Kirill A. Shutemov Cc: Hugh Dickins Cc: David Rientjes Cc: Aaron Lu Cc: Andrew Morton Signed-off-by: Yang Shi --- Documentation/admin-guide/mm/transhuge.rst | 7 ------- include/linux/huge_mm.h | 4 ---- mm/huge_memory.c | 22 ++-------------------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index 7ab93a8..d471ce8 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -148,13 +148,6 @@ madvise never should be self-explanatory. -By default kernel tries to use huge zero page on read page fault to -anonymous mapping. It's possible to disable huge zero page by writing 0 -or enable it back by writing 1:: - - echo 0 >/sys/kernel/mm/transparent_hugepage/use_zero_page - echo 1 >/sys/kernel/mm/transparent_hugepage/use_zero_page - Some userspace (such as a test program, or an optimized memory allocation library) may want to know the size (in bytes) of a transparent hugepage:: diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index a8a1262..0ea7808 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -58,7 +58,6 @@ enum transparent_hugepage_flag { TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG, - TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG, #ifdef CONFIG_DEBUG_VM TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, #endif @@ -116,9 +115,6 @@ static inline bool transparent_hugepage_enabled(struct vm_area_struct *vma) return false; } -#define transparent_hugepage_use_zero_page() \ - (transparent_hugepage_flags & \ - (1<vm_flags))) return VM_FAULT_OOM; if (!(vmf->flags & FAULT_FLAG_WRITE) && - !mm_forbids_zeropage(vma->vm_mm) && - transparent_hugepage_use_zero_page()) { + !mm_forbids_zeropage(vma->vm_mm)) { pgtable_t pgtable; struct page *zero_page; bool set;