From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 12234C2D0DB for ; Thu, 30 Jan 2020 22:12:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C50D120707 for ; Thu, 30 Jan 2020 22:12:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q4TYsJxY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C50D120707 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 575E86B0394; Thu, 30 Jan 2020 17:12:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5266B6B0395; Thu, 30 Jan 2020 17:12:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43B506B0396; Thu, 30 Jan 2020 17:12:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 30D626B0394 for ; Thu, 30 Jan 2020 17:12:24 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E2223824805A for ; Thu, 30 Jan 2020 22:12:23 +0000 (UTC) X-FDA: 76435700166.25.head97_31ffac011100f X-HE-Tag: head97_31ffac011100f X-Filterd-Recvd-Size: 3610 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Thu, 30 Jan 2020 22:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580422342; h=from:from:reply-to: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: in-reply-to:in-reply-to:references:references; bh=KfFc127SnO6KuRPx4SNJJj4LJ7D4DUzqTT6izAq0vIU=; b=Q4TYsJxYkTRtr2SgN8t3j6GSkYAoKzUHmPdXzdcwmYc9LucOJfHMwN6PnHgFEo+JUbBu/R PXbBvfts4DtqalOTWa74sKAeX89q3c5XSTd77EDLtfMUKIBpg3Pjy58JnphvnQsS1ea34B 8Aj51PROX5iBiYelXKib4zYXpDXCRxM= 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-18-utIlZSK7MCixmfRgrzKzYA-1; Thu, 30 Jan 2020 17:12:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 175548EFDA9; Thu, 30 Jan 2020 22:12:18 +0000 (UTC) Received: from localhost.localdomain (vpn2-54-25.bne.redhat.com [10.64.54.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B433C5E254; Thu, 30 Jan 2020 22:12:15 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store} To: Michal Hocko Cc: linux-mm@kvack.org, aarcange@redhat.com, akpm@linux-foundation.org References: <20200130022441.95488-1-gshan@redhat.com> <20200130074901.GR24244@dhcp22.suse.cz> From: Gavin Shan Message-ID: <010e4e48-f3ea-76f0-6e64-518eec980a5e@redhat.com> Date: Fri, 31 Jan 2020 09:12:12 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20200130074901.GR24244@dhcp22.suse.cz> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: utIlZSK7MCixmfRgrzKzYA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: On 1/30/20 6:49 PM, Michal Hocko wrote: > On Thu 30-01-20 13:24:38, Gavin Shan wrote: >> 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. > > Do we really care? This is a root only interface and we do expect root > to know how to use the interface. > I'm not sure actually, but the behavior (suffix matching) isn't well documented in admin-guide/mm/transhuge.rst at least. I think it's not bad to enforce a full matching here because even root user can input something wrong :) Thanks, Gavin. >> # 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(-) >> >> -- >> 2.23.0 >> >