From patchwork Thu Jan 30 02:24:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 11357339 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAD4D1395 for ; Thu, 30 Jan 2020 02:24:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 87076206F0 for ; Thu, 30 Jan 2020 02:24:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JFhjBvUn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87076206F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B62A86B02C9; Wed, 29 Jan 2020 21:24:51 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B136B6B02CA; Wed, 29 Jan 2020 21:24:51 -0500 (EST) 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 A4F286B02CB; Wed, 29 Jan 2020 21:24:51 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 8F8336B02C9 for ; Wed, 29 Jan 2020 21:24:51 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 48EC8281A for ; Thu, 30 Jan 2020 02:24:51 +0000 (UTC) X-FDA: 76432707582.02.shame26_d2d0b9a95225 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,gshan@redhat.com,::aarcange@redhat.com:akpm@linux-foundation.org:mhocko@suse.com,RULES_HIT:30054,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:48,LUA_SUMMARY:none X-HE-Tag: shame26_d2d0b9a95225 X-Filterd-Recvd-Size: 2685 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 30 Jan 2020 02:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580351089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLQ4QVUXtKHYmPXuZGnrzer36iXdX9uDCBwRUN95OFY=; b=JFhjBvUnJ/b5k/ec0DO/x/6X78qoDa2gWUuswJ0rqpKojHVLTzvY8kKU1kIadauxB67mOW vFzZmyuQ26OVSwzJTfHYY9TgSWVxpT5Dt2zPD7tIW7FR/2mormGJqT4x921sd5YD0vdYTk Pdv2vw8NjSPthd9Ywtxc97iXJnH1HZg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-cagOwVUSN2uXP76g1e_jWg-1; Wed, 29 Jan 2020 21:24:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9026013E2; Thu, 30 Jan 2020 02:24:47 +0000 (UTC) Received: from localhost.localdomain.com (vpn2-54-25.bne.redhat.com [10.64.54.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0348C10027BA; Thu, 30 Jan 2020 02:24:45 +0000 (UTC) From: Gavin Shan To: linux-mm@kvack.org Cc: aarcange@redhat.com, akpm@linux-foundation.org, mhocko@suse.com Subject: [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store} Date: Thu, 30 Jan 2020 13:24:38 +1100 Message-Id: <20200130022441.95488-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: cagOwVUSN2uXP76g1e_jWg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: The inappropriate settings can be accepted by "enabled" and "defrag" interface, as the following example shows. This series reworks the related functions and fixes the issue by the way. # cat /sys/kernel/mm/transparent_hugepage/enabled always [madvise] never # echo neveroff > /sys/kernel/mm/transparent_hugepage/enabled # cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never] Gavin Shan (3): mm: Rework {enabled,defrag}_store() mm: Rework {enabled,defrag}_show() mm: Rework setup_transparent_hugepage() mm/huge_memory.c | 216 +++++++++++++++++++++++++++-------------------- 1 file changed, 125 insertions(+), 91 deletions(-)