Thread (38 messages) 38 messages, 8 authors, 2021-02-25

Re: [PATCH RFC] mm/madvise: introduce MADV_POPULATE to prefault/prealloc memory

From: Michal Hocko <mhocko@suse.com>
Date: 2021-02-18 13:44:24
Also in: linux-alpha, linux-arch, linux-mips, lkml

On Thu 18-02-21 11:54:48, David Hildenbrand wrote:
quoted
quoted
quoted
     If we hit
     hardware errors on pages, ignore them - nothing we really can or
     should do.
3. On errors during MADV_POPULATED, some memory might have been
     populated. Callers have to clean up if they care.
How does caller find out? madvise reports 0 on success so how do you
find out how much has been populated?
If there is an error, something might have been populated. In my QEMU
implementation, I simply discard the range again, good enough. I don't
think we need to really indicate "error and populated" or "error and not
populated".
Clarifying again: if madvise(MADV_POPULATED) succeeds, it returns 0. If
there was a problem poopulating memory, it returns -ENOMEM (similar to
MADV_WILLNEED). Callers can detect the error and discard.
As responded to the previous mail. I wouldn't really bother telling
callers what they should do. The interface will not give them any means
to identify the error. They just have to live with the fact that the
operation has failed.
-- 
Michal Hocko
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help