On Tue, Jan 24 2017, Theodore Ts'o wrote: > On Sun, Jan 22, 2017 at 10:05:44PM -0800, Matthew Wilcox wrote: >> >> I don't have a clear picture in my mind of when Java promotes objects >> from nursery to tenure > > It's typically on the order of minutes. :-) > >> ... which is not too different from my lack of >> understanding of what the MM layer considers "temporary" :-) Is it >> acceptable usage to allocate a SCSI command (guaranteed to be freed >> within 30 seconds) from the temporary area? Or should it only be used >> for allocations where the thread of control is not going to sleep between >> allocation and freeing? > > What the mm folks have said is that it's to prevent fragmentation. If > that's the optimization, whether or not you the process is allocating > the memory sleeps for a few hundred milliseconds, or even seconds, is > really in the noise compared with the average lifetime of an inode in > the inode cache, or a page in the page cache.... > > Why do you think it matters whether or not we sleep? I've not heard > any explanation for the assumption for why this might be important. Because "TEMPORARY" implies a limit to the amount of time, and sleeping is the thing that causes a process to take a large amount of time. It seems like an obvious connection to me. Imagine I want to allocate a large contiguous region in the ZONE_MOVEABLE region. I find a mostly free region, so I just need to move those last few pages. If there is a limit on how long a process can sleep while holding an allocation from ZONE_MOVEABLE, then I know how long, at most, I need to wait before those pages become either free or movable. If those processes can wait indefinitely, then I might have to wait indefinitely to get this large region. "temporary" doesn't mean anything without a well defined time limit. But maybe I completely misunderstand. NeilBrown