[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc911eac-f843-31a3-f74c-53b0bbcc8817@suse.cz>
Date: Sat, 18 Jan 2020 11:54:15 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: David Rientjes <rientjes@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Mel Gorman <mgorman@...hsingularity.net>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [patch v2] mm, thp: fix defrag setting if newline is not used
On 1/17/20 11:11 PM, 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.
>
> Fixes: 21440d7eb904 ("mm, thp: add new defer+madvise defrag option")
> Cc: Vlastimil Babka <vbabka@...e.cz>
> Cc: Mel Gorman <mgorman@...hsingularity.net>
> Suggested-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: David Rientjes <rientjes@...gle.com>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
Thanks.
Powered by blists - more mailing lists