* [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store}
@ 2020-01-30 2:24 Gavin Shan
2020-01-30 7:49 ` Michal Hocko
0 siblings, 1 reply; 5+ messages in thread
From: Gavin Shan @ 2020-01-30 2:24 UTC (permalink / raw)
To: linux-mm; +Cc: aarcange, akpm, mhocko
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(-)
--
2.23.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store}
2020-01-30 2:24 [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store} Gavin Shan
@ 2020-01-30 7:49 ` Michal Hocko
2020-01-30 9:46 ` Vlastimil Babka
2020-01-30 22:12 ` Gavin Shan
0 siblings, 2 replies; 5+ messages in thread
From: Michal Hocko @ 2020-01-30 7:49 UTC (permalink / raw)
To: Gavin Shan; +Cc: linux-mm, aarcange, akpm
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.
> # 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
>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store}
2020-01-30 7:49 ` Michal Hocko
@ 2020-01-30 9:46 ` Vlastimil Babka
2020-01-30 22:22 ` Gavin Shan
2020-01-30 22:12 ` Gavin Shan
1 sibling, 1 reply; 5+ messages in thread
From: Vlastimil Babka @ 2020-01-30 9:46 UTC (permalink / raw)
To: Michal Hocko, Gavin Shan; +Cc: linux-mm, aarcange, akpm, David Rientjes
On 1/30/20 8:49 AM, 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.
Also I think David already solved even this case with sysfs_streq() that
Andrew suggested:
https://lore.kernel.org/linux-mm/alpine.DEB.2.21.2001171411020.56385@chino.kir.corp.google.com/
>> # 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
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store}
2020-01-30 7:49 ` Michal Hocko
2020-01-30 9:46 ` Vlastimil Babka
@ 2020-01-30 22:12 ` Gavin Shan
1 sibling, 0 replies; 5+ messages in thread
From: Gavin Shan @ 2020-01-30 22:12 UTC (permalink / raw)
To: Michal Hocko; +Cc: linux-mm, aarcange, akpm
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
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store}
2020-01-30 9:46 ` Vlastimil Babka
@ 2020-01-30 22:22 ` Gavin Shan
0 siblings, 0 replies; 5+ messages in thread
From: Gavin Shan @ 2020-01-30 22:22 UTC (permalink / raw)
To: Vlastimil Babka, Michal Hocko; +Cc: linux-mm, aarcange, akpm, David Rientjes
On 1/30/20 8:46 PM, Vlastimil Babka wrote:
> On 1/30/20 8:49 AM, 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.
>
> Also I think David already solved even this case with sysfs_streq() that
> Andrew suggested:
>
> https://lore.kernel.org/linux-mm/alpine.DEB.2.21.2001171411020.56385@chino.kir.corp.google.com/
>
Thanks for the linker. I didn't notice there already have a patch to address
the issue. Also, I perhaps post patch to improve the extendibility on top of
David's patch if you agree. Otherwise, it can be ignored.
By the way, it's nice to know sysfs_streq().
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
>>>
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-30 22:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 2:24 [PATCH 0/3] mm: Rework {enabled,defrag}_{show,store} Gavin Shan
2020-01-30 7:49 ` Michal Hocko
2020-01-30 9:46 ` Vlastimil Babka
2020-01-30 22:22 ` Gavin Shan
2020-01-30 22:12 ` Gavin Shan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).