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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 52DDDC33CB7 for ; Sun, 19 Jan 2020 01:04:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 185B1246AF for ; Sun, 19 Jan 2020 01:04:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="0C41Sgqm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 185B1246AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A9316B0542; Sat, 18 Jan 2020 20:04:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9598D6B0543; Sat, 18 Jan 2020 20:04:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 870936B0544; Sat, 18 Jan 2020 20:04:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 6E13D6B0542 for ; Sat, 18 Jan 2020 20:04:47 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id F0149180AD807 for ; Sun, 19 Jan 2020 01:04:46 +0000 (UTC) X-FDA: 76392588972.03.elbow02_81018f30a7756 X-HE-Tag: elbow02_81018f30a7756 X-Filterd-Recvd-Size: 2829 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Sun, 19 Jan 2020 01:04:46 +0000 (UTC) Received: from X1 (nat-ab2241.sltdut.senawave.net [162.218.216.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C2FC2467C; Sun, 19 Jan 2020 01:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579395885; bh=UC0MjXqTZ9KKw7ixKrMeXOzVZ+e+F/FydRb0OQ8QP+g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0C41Sgqmz28bOgjI6zFREqdPrxnbdmnXsjiXKjgOY4EOwLy+sAGGhFK+nheXzCOcK NfWt2L1hPIUYO2rEUJYVaL7vURlzvXAHqLNjix1AoWw+AdwlTNd+vxikG7MSE839Ia NL1FH+8f2Z7icJoxxWsEDLFMsIH1Njrifecy2OTk= Date: Sat, 18 Jan 2020 17:04:45 -0800 From: Andrew Morton To: David Rientjes Cc: Vlastimil Babka , Mel Gorman , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch v2] mm, thp: fix defrag setting if newline is not used Message-Id: <20200118170445.370d908ce29f42068390addb@linux-foundation.org> In-Reply-To: References: <20200116191609.3972fd5301cf364a27381923@linux-foundation.org> <025511aa-4721-2edb-d658-78d6368a9101@suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Fri, 17 Jan 2020 14:11:48 -0800 (PST) David Rientjes wrote: > If thp defrag setting "defer" is used and a newline is *not* used when > writing to the sysfs file, this is interpreted as the "defer+madvise" > option. > > This is because we do prefix matching and if five characters are written > without a newline, the current code ends up comparing to the first five > bytes of the "defer+madvise" option and using that instead. > > Use the more appropriate sysfs_streq() that handles the trailing newline > for us. Since this doubles as a nice cleanup, do it in enabled_store() > as well. I can't really I really understand this prefix-matching thing that we're taking away. Documentation/admin-guide/mm/transhuge.rst doesn't appear to mention it. Could we please add a paragraph to the changelog to spell all this out. Bonus points for formally describing the behaviour which we're removing! Thanks.