linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
       [not found]                   ` <20181228081847.GP16738@dhcp22.suse.cz>
@ 2018-12-28 10:54                     ` Vlastimil Babka
  2018-12-28 12:19                       ` Michal Hocko
                                         ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Vlastimil Babka @ 2018-12-28 10:54 UTC (permalink / raw)
  To: Michal Hocko, Andrew Morton
  Cc: Kirill A. Shutemov, David Rientjes, kirill.shutemov, adobriyan,
	Linux API, Andrei Vagin, Mike Rapoport, Cyrill Gorcunov,
	Pavel Emelyanov, Linux-MM layout

On 12/28/18 9:18 AM, Michal Hocko wrote:
> On Thu 27-12-18 21:31:00, Andrew Morton wrote:
>> On Thu, 27 Dec 2018 14:11:14 +0300 "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
>>
>>> On Mon, Dec 24, 2018 at 10:17:31AM +0100, Michal Hocko wrote:
>>>> On Mon 24-12-18 01:05:57, David Rientjes wrote:
>>>> [...]
>>>>> I'm not interested in having a 100 email thread about this when a clear 
>>>>> and simple fix exists that actually doesn't break user code.
>>>>
>>>> You are breaking everybody who really wants to query MADV_NOHUGEPAGE
>>>> status by this flag. Is there anybody doing that?
>>>
>>> Yes.
>>>
>>> https://github.com/checkpoint-restore/criu/blob/v3.11/criu/proc_parse.c#L143
>>
>> Ugh.  So the regression fix causes a regression?
> 
> Yes. The patch from David will hardcode the nohugepage vm flag if the
> THP was disabled by the prctl at the time of the snapshot. And if the
> application later enables THP by the prctl then existing mappings would
> never get the THP enabled status back.
> 
> This is the kind of a potential regression I was poiting out earlier
> when explaining that the patch encodes the logic into the flag exporting
> and that means that whoever wants to get the raw value of the flag will
> not be able to do so. Please note that the raw value is exactly what
> this interface is documented and supposed to export. And as the
> documentation explains it is implementation specific and anybody to use
> it should be careful.

Let's add some CRIU guys in the loop (dunno if the right ones). We're
discussing David's patch [1] that makes 'nh' and 'hg' flags reported in
/proc/pid/smaps (and set by madvise) overridable by
prctl(PR_SET_THP_DISABLE). This was sort of accidental behavior (but
only for mappings created after the prctl call) before 4.13 commit
1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active").

For David's userspace that commit is a regression as there are false
positives when checking for vma's that are eligible for THP (=don't have
the 'nh' flag in smaps) but didn't really obtain THP's. The userspace
assumes it's due to fragmentation (=bad) and cannot know that it's due
to the prctl(). But we fear that making prctl() affect smaps vma flags
means that CRIU can't query them accurately anymore, and thus it's a
regression for CRIU. Can you comment on that?
Michal has a patch [2] that reports the prctl() status separately, but
that doesn't help David's existing userspace. For CRIU this also won't
help as long the smaps vma flags still silently included the prctl()
status. Do you see some solution that would work for everybody?

[1]
https://www.ozlabs.org/~akpm/mmots/broken-out/mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch
[2]
https://www.ozlabs.org/~akpm/mmots/broken-out/mm-proc-report-pr_set_thp_disable-in-proc.patch

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2018-12-28 10:54                     ` + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree Vlastimil Babka
@ 2018-12-28 12:19                       ` Michal Hocko
  2018-12-28 12:35                       ` Cyrill Gorcunov
                                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Michal Hocko @ 2018-12-28 12:19 UTC (permalink / raw)
  To: Vlastimil Babka, David Rientjes
  Cc: Andrew Morton, Kirill A. Shutemov, kirill.shutemov, adobriyan,
	Linux API, Andrei Vagin, Mike Rapoport, Cyrill Gorcunov,
	Pavel Emelyanov, Linux-MM layout

On Fri 28-12-18 11:54:17, Vlastimil Babka wrote:
[...]
> Michal has a patch [2] that reports the prctl() status separately, but
> that doesn't help David's existing userspace.

This is something that is not really clear to me. I have asked several
times already and never got any reply IIRC. The code is obviously very
specific for their setup. Why is it not viable to update the code
in question now that a long term, easily backportable and properly
supported API exists?

I do understand that a lack of such an API pushes people to use whatever
sounds usable (even when undocumented) but we do have that interface
now. So what is the roadblock?

Or do we really want to make vma flags properly supported and carved in
stone interface?
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2018-12-28 10:54                     ` + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree Vlastimil Babka
  2018-12-28 12:19                       ` Michal Hocko
@ 2018-12-28 12:35                       ` Cyrill Gorcunov
  2018-12-30 17:55                       ` Mike Rapoport
  2019-01-15  6:32                       ` Mike Rapoport
  3 siblings, 0 replies; 9+ messages in thread
From: Cyrill Gorcunov @ 2018-12-28 12:35 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Michal Hocko, Andrew Morton, Kirill A. Shutemov, David Rientjes,
	kirill.shutemov, adobriyan, Linux API, Andrei Vagin,
	Mike Rapoport, Pavel Emelyanov, Linux-MM layout

On Fri, Dec 28, 2018 at 11:54:17AM +0100, Vlastimil Babka wrote:
...
> Let's add some CRIU guys in the loop (dunno if the right ones). We're
> discussing David's patch [1] that makes 'nh' and 'hg' flags reported in
> /proc/pid/smaps (and set by madvise) overridable by
> prctl(PR_SET_THP_DISABLE). This was sort of accidental behavior (but
> only for mappings created after the prctl call) before 4.13 commit
> 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active").
> 
> For David's userspace that commit is a regression as there are false
> positives when checking for vma's that are eligible for THP (=don't have
> the 'nh' flag in smaps) but didn't really obtain THP's. The userspace
> assumes it's due to fragmentation (=bad) and cannot know that it's due
> to the prctl(). But we fear that making prctl() affect smaps vma flags
> means that CRIU can't query them accurately anymore, and thus it's a
> regression for CRIU. Can you comment on that?
> Michal has a patch [2] that reports the prctl() status separately, but
> that doesn't help David's existing userspace. For CRIU this also won't
> help as long the smaps vma flags still silently included the prctl()
> status. Do you see some solution that would work for everybody?
> 
> [1]
> https://www.ozlabs.org/~akpm/mmots/broken-out/mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch
> [2]
> https://www.ozlabs.org/~akpm/mmots/broken-out/mm-proc-report-pr_set_thp_disable-in-proc.patch

First of all, thanks for CC'ing. Pavel and Mike should know more about
criu's part of THP. We'are using the smaps flags on later restore stage
only where we call madvise on particular vma area. But from general pov
it is fishy to hardcode nh flag into smaps report depedning on prctl flag
-- prctl and madvise are two different interfaces. Is it possible for
David to update their userspace tools instead? I know it shounds as
we're violating 'don't-break-user-space' term but with ability to
parse /proc/pid/status to figure out if thp is enabled/disabled should
not be that hard.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2018-12-28 10:54                     ` + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree Vlastimil Babka
  2018-12-28 12:19                       ` Michal Hocko
  2018-12-28 12:35                       ` Cyrill Gorcunov
@ 2018-12-30 17:55                       ` Mike Rapoport
  2019-01-15  6:32                       ` Mike Rapoport
  3 siblings, 0 replies; 9+ messages in thread
From: Mike Rapoport @ 2018-12-30 17:55 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Michal Hocko, Andrew Morton, Kirill A. Shutemov, David Rientjes,
	kirill.shutemov, adobriyan, Linux API, Andrei Vagin,
	Mike Rapoport, Cyrill Gorcunov, Pavel Emelyanov, Linux-MM layout

On Fri, Dec 28, 2018 at 11:54:17AM +0100, Vlastimil Babka wrote:
> On 12/28/18 9:18 AM, Michal Hocko wrote:
> > On Thu 27-12-18 21:31:00, Andrew Morton wrote:
> >> On Thu, 27 Dec 2018 14:11:14 +0300 "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> >>
> >>> On Mon, Dec 24, 2018 at 10:17:31AM +0100, Michal Hocko wrote:
> >>>> On Mon 24-12-18 01:05:57, David Rientjes wrote:
> >>>> [...]
> >>>>> I'm not interested in having a 100 email thread about this when a clear 
> >>>>> and simple fix exists that actually doesn't break user code.
> >>>>
> >>>> You are breaking everybody who really wants to query MADV_NOHUGEPAGE
> >>>> status by this flag. Is there anybody doing that?
> >>>
> >>> Yes.
> >>>
> >>> https://github.com/checkpoint-restore/criu/blob/v3.11/criu/proc_parse.c#L143
> >>
> >> Ugh.  So the regression fix causes a regression?
> > 
> > Yes. The patch from David will hardcode the nohugepage vm flag if the
> > THP was disabled by the prctl at the time of the snapshot. And if the
> > application later enables THP by the prctl then existing mappings would
> > never get the THP enabled status back.
> > 
> > This is the kind of a potential regression I was poiting out earlier
> > when explaining that the patch encodes the logic into the flag exporting
> > and that means that whoever wants to get the raw value of the flag will
> > not be able to do so. Please note that the raw value is exactly what
> > this interface is documented and supposed to export. And as the
> > documentation explains it is implementation specific and anybody to use
> > it should be careful.
> 
> Let's add some CRIU guys in the loop (dunno if the right ones). We're
> discussing David's patch [1] that makes 'nh' and 'hg' flags reported in
> /proc/pid/smaps (and set by madvise) overridable by
> prctl(PR_SET_THP_DISABLE). This was sort of accidental behavior (but
> only for mappings created after the prctl call) before 4.13 commit
> 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active").
> 
> For David's userspace that commit is a regression as there are false
> positives when checking for vma's that are eligible for THP (=don't have
> the 'nh' flag in smaps) but didn't really obtain THP's. The userspace
> assumes it's due to fragmentation (=bad) and cannot know that it's due
> to the prctl(). But we fear that making prctl() affect smaps vma flags
> means that CRIU can't query them accurately anymore, and thus it's a
> regression for CRIU. Can you comment on that?

CRIU parses VmFlags from /proc/pid/smaps during the checkpoint and then
uses their raw values to recreate exactly the same mappings during restore.
We use appropriate madvise() calls to re-establish VMA flags.

Implicitly setting the 'nh' flag in /proc/pid/smaps when THP usage was
restricted with prctl() will make CRIU to call madvise(MADV_NOHUPEPAGE) for
all the mappings with 'nh' set as CRIU cannot detect the actual reason for
VMA being marked as VM_NOHUGEPAGE.

As Andrew pointed out, if the restored process will re-enable THP with
prtcl(), the VMAs will retail VM_NOHUGEPAGE flag. And, I don't see how can
we work around this in CRIU.

> Michal has a patch [2] that reports the prctl() status separately, but
> that doesn't help David's existing userspace. For CRIU this also won't
> help as long the smaps vma flags still silently included the prctl()
> status. Do you see some solution that would work for everybody?

Nothing comes to mind at the moment, maybe next year ;-)

> [1]
> https://www.ozlabs.org/~akpm/mmots/broken-out/mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch
> [2]
> https://www.ozlabs.org/~akpm/mmots/broken-out/mm-proc-report-pr_set_thp_disable-in-proc.patch
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2018-12-28 10:54                     ` + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree Vlastimil Babka
                                         ` (2 preceding siblings ...)
  2018-12-30 17:55                       ` Mike Rapoport
@ 2019-01-15  6:32                       ` Mike Rapoport
  2019-01-21 10:21                         ` Michal Hocko
  3 siblings, 1 reply; 9+ messages in thread
From: Mike Rapoport @ 2019-01-15  6:32 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Michal Hocko, Andrew Morton, Kirill A. Shutemov, David Rientjes,
	kirill.shutemov, adobriyan, Linux API, Andrei Vagin,
	Mike Rapoport, Cyrill Gorcunov, Pavel Emelyanov, Linux-MM layout

Hi,

The holidays are over and I think it's time to resurrect this thread.

On Fri, Dec 28, 2018 at 11:54:17AM +0100, Vlastimil Babka wrote:
> On 12/28/18 9:18 AM, Michal Hocko wrote:
> > On Thu 27-12-18 21:31:00, Andrew Morton wrote:
> >> On Thu, 27 Dec 2018 14:11:14 +0300 "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> >>
> >>> On Mon, Dec 24, 2018 at 10:17:31AM +0100, Michal Hocko wrote:
> >>>> On Mon 24-12-18 01:05:57, David Rientjes wrote:
> >>>> [...]
> >>>>> I'm not interested in having a 100 email thread about this when a clear 
> >>>>> and simple fix exists that actually doesn't break user code.
> >>>>
> >>>> You are breaking everybody who really wants to query MADV_NOHUGEPAGE
> >>>> status by this flag. Is there anybody doing that?
> >>>
> >>> Yes.
> >>>
> >>> https://github.com/checkpoint-restore/criu/blob/v3.11/criu/proc_parse.c#L143
> >>
> >> Ugh.  So the regression fix causes a regression?
> > 
> > Yes. The patch from David will hardcode the nohugepage vm flag if the
> > THP was disabled by the prctl at the time of the snapshot. And if the
> > application later enables THP by the prctl then existing mappings would
> > never get the THP enabled status back.
> > 
> > This is the kind of a potential regression I was poiting out earlier
> > when explaining that the patch encodes the logic into the flag exporting
> > and that means that whoever wants to get the raw value of the flag will
> > not be able to do so. Please note that the raw value is exactly what
> > this interface is documented and supposed to export. And as the
> > documentation explains it is implementation specific and anybody to use
> > it should be careful.
> 
> Let's add some CRIU guys in the loop (dunno if the right ones). We're
> discussing David's patch [1] that makes 'nh' and 'hg' flags reported in
> /proc/pid/smaps (and set by madvise) overridable by
> prctl(PR_SET_THP_DISABLE). This was sort of accidental behavior (but
> only for mappings created after the prctl call) before 4.13 commit
> 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active").
> 
> For David's userspace that commit is a regression as there are false
> positives when checking for vma's that are eligible for THP (=don't have
> the 'nh' flag in smaps) but didn't really obtain THP's. The userspace
> assumes it's due to fragmentation (=bad) and cannot know that it's due
> to the prctl(). But we fear that making prctl() affect smaps vma flags
> means that CRIU can't query them accurately anymore, and thus it's a
> regression for CRIU. Can you comment on that?
> Michal has a patch [2] that reports the prctl() status separately, but
> that doesn't help David's existing userspace. For CRIU this also won't
> help as long the smaps vma flags still silently included the prctl()
> status. Do you see some solution that would work for everybody?

The patch from David obviously breaks CRIU, and I can't see a nice solution
that will work for everybody.

Of course we could add something like 'NH' to /proc/pid/smaps so that 'nh'
will work as David's userspace is expecting and 'NH' will represent the
state of VmFlags. This is hackish and ugly, though.

In any case, if David's patch is not reverted CRIU needs some way to know
if VMA has VM_NOHUGEPAGE set.

> [1]
> https://www.ozlabs.org/~akpm/mmots/broken-out/mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch
> [2]
> https://www.ozlabs.org/~akpm/mmots/broken-out/mm-proc-report-pr_set_thp_disable-in-proc.patch
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2019-01-15  6:32                       ` Mike Rapoport
@ 2019-01-21 10:21                         ` Michal Hocko
  2019-01-21 18:00                           ` Cyrill Gorcunov
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Hocko @ 2019-01-21 10:21 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton
  Cc: Vlastimil Babka, Kirill A. Shutemov, David Rientjes,
	kirill.shutemov, adobriyan, Linux API, Andrei Vagin,
	Mike Rapoport, Cyrill Gorcunov, Pavel Emelyanov, Linux-MM layout

On Tue 15-01-19 08:32:02, Mike Rapoport wrote:
> Hi,
> 
> The holidays are over and I think it's time to resurrect this thread.
> 
> On Fri, Dec 28, 2018 at 11:54:17AM +0100, Vlastimil Babka wrote:
> > On 12/28/18 9:18 AM, Michal Hocko wrote:
> > > On Thu 27-12-18 21:31:00, Andrew Morton wrote:
> > >> On Thu, 27 Dec 2018 14:11:14 +0300 "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> > >>
> > >>> On Mon, Dec 24, 2018 at 10:17:31AM +0100, Michal Hocko wrote:
> > >>>> On Mon 24-12-18 01:05:57, David Rientjes wrote:
> > >>>> [...]
> > >>>>> I'm not interested in having a 100 email thread about this when a clear 
> > >>>>> and simple fix exists that actually doesn't break user code.
> > >>>>
> > >>>> You are breaking everybody who really wants to query MADV_NOHUGEPAGE
> > >>>> status by this flag. Is there anybody doing that?
> > >>>
> > >>> Yes.
> > >>>
> > >>> https://github.com/checkpoint-restore/criu/blob/v3.11/criu/proc_parse.c#L143
> > >>
> > >> Ugh.  So the regression fix causes a regression?
> > > 
> > > Yes. The patch from David will hardcode the nohugepage vm flag if the
> > > THP was disabled by the prctl at the time of the snapshot. And if the
> > > application later enables THP by the prctl then existing mappings would
> > > never get the THP enabled status back.
> > > 
> > > This is the kind of a potential regression I was poiting out earlier
> > > when explaining that the patch encodes the logic into the flag exporting
> > > and that means that whoever wants to get the raw value of the flag will
> > > not be able to do so. Please note that the raw value is exactly what
> > > this interface is documented and supposed to export. And as the
> > > documentation explains it is implementation specific and anybody to use
> > > it should be careful.
> > 
> > Let's add some CRIU guys in the loop (dunno if the right ones). We're
> > discussing David's patch [1] that makes 'nh' and 'hg' flags reported in
> > /proc/pid/smaps (and set by madvise) overridable by
> > prctl(PR_SET_THP_DISABLE). This was sort of accidental behavior (but
> > only for mappings created after the prctl call) before 4.13 commit
> > 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active").
> > 
> > For David's userspace that commit is a regression as there are false
> > positives when checking for vma's that are eligible for THP (=don't have
> > the 'nh' flag in smaps) but didn't really obtain THP's. The userspace
> > assumes it's due to fragmentation (=bad) and cannot know that it's due
> > to the prctl(). But we fear that making prctl() affect smaps vma flags
> > means that CRIU can't query them accurately anymore, and thus it's a
> > regression for CRIU. Can you comment on that?
> > Michal has a patch [2] that reports the prctl() status separately, but
> > that doesn't help David's existing userspace. For CRIU this also won't
> > help as long the smaps vma flags still silently included the prctl()
> > status. Do you see some solution that would work for everybody?
> 
> The patch from David obviously breaks CRIU, and I can't see a nice solution
> that will work for everybody.
> 
> Of course we could add something like 'NH' to /proc/pid/smaps so that 'nh'
> will work as David's userspace is expecting and 'NH' will represent the
> state of VmFlags. This is hackish and ugly, though.
> 
> In any case, if David's patch is not reverted CRIU needs some way to know
> if VMA has VM_NOHUGEPAGE set.

Hmm, there doesn't seem to be any follow up here and the patch is still
in the mmotm tree AFAICS in mainline-urgent section. I thought it was
clarified that the patch will break an existing userspace that relies on
the documented semantic.

While it is unfortunate that the use case mentioned by David got broken
we have provided a long term sustainable which is much better than
relying on an undocumented side effect of the prctl implementation at
the time.

So can we make a decision on this finally please?

> > [1]
> > https://www.ozlabs.org/~akpm/mmots/broken-out/mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch
> > [2]
> > https://www.ozlabs.org/~akpm/mmots/broken-out/mm-proc-report-pr_set_thp_disable-in-proc.patch
> > 
> 
> -- 
> Sincerely yours,
> Mike.

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2019-01-21 10:21                         ` Michal Hocko
@ 2019-01-21 18:00                           ` Cyrill Gorcunov
  2019-01-21 18:18                             ` Michal Hocko
  0 siblings, 1 reply; 9+ messages in thread
From: Cyrill Gorcunov @ 2019-01-21 18:00 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Mike Rapoport, Andrew Morton, Vlastimil Babka,
	Kirill A. Shutemov, David Rientjes, kirill.shutemov, adobriyan,
	Linux API, Andrei Vagin, Mike Rapoport, Pavel Emelyanov,
	Linux-MM layout

On Mon, Jan 21, 2019 at 11:21:44AM +0100, Michal Hocko wrote:
...
> > 
> > The patch from David obviously breaks CRIU, and I can't see a nice solution
> > that will work for everybody.
> > 
> > Of course we could add something like 'NH' to /proc/pid/smaps so that 'nh'
> > will work as David's userspace is expecting and 'NH' will represent the
> > state of VmFlags. This is hackish and ugly, though.
> > 
> > In any case, if David's patch is not reverted CRIU needs some way to know
> > if VMA has VM_NOHUGEPAGE set.
> 
> Hmm, there doesn't seem to be any follow up here and the patch is still
> in the mmotm tree AFAICS in mainline-urgent section. I thought it was
> clarified that the patch will break an existing userspace that relies on
> the documented semantic.
> 
> While it is unfortunate that the use case mentioned by David got broken
> we have provided a long term sustainable which is much better than
> relying on an undocumented side effect of the prctl implementation at
> the time.
> 
> So can we make a decision on this finally please?

As to me David's userspace application could use /proc/$pid/status
to fetch precise THP state. And the patch in mm queue simply breaks
others userspace thus should be reverted.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2019-01-21 18:00                           ` Cyrill Gorcunov
@ 2019-01-21 18:18                             ` Michal Hocko
  2019-01-21 18:24                               ` Cyrill Gorcunov
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Hocko @ 2019-01-21 18:18 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: Mike Rapoport, Andrew Morton, Vlastimil Babka,
	Kirill A. Shutemov, David Rientjes, kirill.shutemov, adobriyan,
	Linux API, Andrei Vagin, Mike Rapoport, Pavel Emelyanov,
	Linux-MM layout

On Mon 21-01-19 21:00:29, Cyrill Gorcunov wrote:
> On Mon, Jan 21, 2019 at 11:21:44AM +0100, Michal Hocko wrote:
> ...
> > > 
> > > The patch from David obviously breaks CRIU, and I can't see a nice solution
> > > that will work for everybody.
> > > 
> > > Of course we could add something like 'NH' to /proc/pid/smaps so that 'nh'
> > > will work as David's userspace is expecting and 'NH' will represent the
> > > state of VmFlags. This is hackish and ugly, though.
> > > 
> > > In any case, if David's patch is not reverted CRIU needs some way to know
> > > if VMA has VM_NOHUGEPAGE set.
> > 
> > Hmm, there doesn't seem to be any follow up here and the patch is still
> > in the mmotm tree AFAICS in mainline-urgent section. I thought it was
> > clarified that the patch will break an existing userspace that relies on
> > the documented semantic.
> > 
> > While it is unfortunate that the use case mentioned by David got broken
> > we have provided a long term sustainable which is much better than
> > relying on an undocumented side effect of the prctl implementation at
> > the time.
> > 
> > So can we make a decision on this finally please?
> 
> As to me David's userspace application could use /proc/$pid/status
> to fetch precise THP state. And the patch in mm queue simply breaks
> others userspace thus should be reverted.

7635d9cbe832 ("mm, thp, proc: report THP eligibility for each vma") will
provide even more detailed information because it displays THP
eligibility per VMA so you do not have to check all other conditions
that control THP.

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree
  2019-01-21 18:18                             ` Michal Hocko
@ 2019-01-21 18:24                               ` Cyrill Gorcunov
  0 siblings, 0 replies; 9+ messages in thread
From: Cyrill Gorcunov @ 2019-01-21 18:24 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Mike Rapoport, Andrew Morton, Vlastimil Babka,
	Kirill A. Shutemov, David Rientjes, kirill.shutemov, adobriyan,
	Linux API, Andrei Vagin, Mike Rapoport, Pavel Emelyanov,
	Linux-MM layout

On Mon, Jan 21, 2019 at 07:18:24PM +0100, Michal Hocko wrote:
> > > 
> > > So can we make a decision on this finally please?
> > 
> > As to me David's userspace application could use /proc/$pid/status
> > to fetch precise THP state. And the patch in mm queue simply breaks
> > others userspace thus should be reverted.
> 
> 7635d9cbe832 ("mm, thp, proc: report THP eligibility for each vma") will
> provide even more detailed information because it displays THP
> eligibility per VMA so you do not have to check all other conditions
> that control THP.

Thus the only thing we need is to wait for David's reply if he can
update his application to use the THPeligible flag and drop the
patch from mm queue

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-21 18:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <alpine.DEB.2.21.1812210123210.232416@chino.kir.corp.google.com>
     [not found] ` <14e15543-c18b-6fa0-e107-194216ef3ada@suse.cz>
     [not found]   ` <20181221151256.GA6410@dhcp22.suse.cz>
     [not found]     ` <20181221140301.0e87b79b923ceb6d0f683749@linux-foundation.org>
     [not found]       ` <alpine.DEB.2.21.1812211419320.219499@chino.kir.corp.google.com>
     [not found]         ` <20181224080426.GC9063@dhcp22.suse.cz>
     [not found]           ` <alpine.DEB.2.21.1812240058060.114867@chino.kir.corp.google.com>
     [not found]             ` <20181224091731.GB16738@dhcp22.suse.cz>
     [not found]               ` <20181227111114.5tvvkddyp7cytzeb@kshutemo-mobl1>
     [not found]                 ` <20181227213100.aeee730c1f9ec5cb11de39a3@linux-foundation.org>
     [not found]                   ` <20181228081847.GP16738@dhcp22.suse.cz>
2018-12-28 10:54                     ` + mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch added to -mm tree Vlastimil Babka
2018-12-28 12:19                       ` Michal Hocko
2018-12-28 12:35                       ` Cyrill Gorcunov
2018-12-30 17:55                       ` Mike Rapoport
2019-01-15  6:32                       ` Mike Rapoport
2019-01-21 10:21                         ` Michal Hocko
2019-01-21 18:00                           ` Cyrill Gorcunov
2019-01-21 18:18                             ` Michal Hocko
2019-01-21 18:24                               ` Cyrill Gorcunov

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).