* Re: OOM at low page cache?
2015-01-28 6:26 ` Minchan Kim
@ 2015-01-28 12:36 ` Rik van Riel
2015-01-28 14:13 ` John Moser
2015-01-28 14:15 ` John Moser
2015-01-28 14:27 ` John Moser
2 siblings, 1 reply; 7+ messages in thread
From: Rik van Riel @ 2015-01-28 12:36 UTC (permalink / raw)
To: Minchan Kim, Vlastimil Babka
Cc: John Moser, linux-kernel, linux-mm@kvack.org, Johannes Weiner,
KOSAKI Motohiro, Kamezawa Hiroyuki, Christoph Lameter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/28/2015 01:26 AM, Minchan Kim wrote:
> Hello,
>
> On Tue, Jan 27, 2015 at 12:03:34PM +0100, Vlastimil Babka wrote:
>> CC linux-mm in case somebody has a good answer but missed this in
>> lkml traffic
>>
>> On 01/23/2015 11:18 PM, John Moser wrote:
>>> Why is there no tunable to OOM at low page cache?
>
> AFAIR, there were several trial although there wasn't acceptable at
> that time. One thing I can remember is min_filelist_kbytes. FYI,
> http://lwn.net/Articles/412313/
The Android low memory killer does exactly what you want, and
for very much the same reasons.
See drivers/staging/android/lowmemorykiller.c
However, in the mainline kernel I think it does make sense to
apply something like the patch that Minchan cooked up with, to OOM
if freeing all the page cache could not bring us back up to the high
watermark, across all the memory zones.
- --
All rights reversed
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJUyNewAAoJEM553pKExN6DlKQH/3PprrXF7IOyjiXnO+2Qqbau
wgWXO7mQWGFi+zNqSUzmWtfTCFVx6BxLi23MCQG1RqKGnQI4DehdOKMDidFwoC8D
2grKe9ELp04mEbyG0aipdxSw6FouIDFhC2FzmU7oQDZX5RKmLuxY7QPU4NTCitcR
xHp6jWrvyY2CDiSpA2QSAaAAIG21BtPJvXQg3WvY/LI03N1edqZnExt5Po8CY7oe
EeiO7ZtYISl/wRIoribEafZF4rMAfJ5A36kdbulqCqVtgCWEDPV0RCXimc5EtDIt
bFDiv924+YMiuEFULJlEqLGqTJOtfJ+NlBIn8nVRk5P1pOGEbO05zE+XV1Vea6k=
=8351
-----END PGP SIGNATURE-----
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: OOM at low page cache?
2015-01-28 12:36 ` Rik van Riel
@ 2015-01-28 14:13 ` John Moser
0 siblings, 0 replies; 7+ messages in thread
From: John Moser @ 2015-01-28 14:13 UTC (permalink / raw)
To: Rik van Riel, Minchan Kim, Vlastimil Babka
Cc: linux-kernel, linux-mm@kvack.org, Johannes Weiner,
KOSAKI Motohiro, Kamezawa Hiroyuki, Christoph Lameter
[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]
On 01/28/2015 07:36 AM, Rik van Riel wrote:
> On 01/28/2015 01:26 AM, Minchan Kim wrote:
> > Hello,
>
> > On Tue, Jan 27, 2015 at 12:03:34PM +0100, Vlastimil Babka wrote:
> >> CC linux-mm in case somebody has a good answer but missed this in
> >> lkml traffic
> >>
> >> On 01/23/2015 11:18 PM, John Moser wrote:
> >>> Why is there no tunable to OOM at low page cache?
>
> > AFAIR, there were several trial although there wasn't acceptable at
> > that time. One thing I can remember is min_filelist_kbytes. FYI,
> > http://lwn.net/Articles/412313/
>
> The Android low memory killer does exactly what you want, and
> for very much the same reasons.
>
> See drivers/staging/android/lowmemorykiller.c
>
Haven't seen that; it's been a long time since I bothered myself with
kernel code, so I'm out-of-touch.
Wow lots of good responses coming quick.
> However, in the mainline kernel I think it does make sense to
> apply something like the patch that Minchan cooked up with, to OOM
> if freeing all the page cache could not bring us back up to the high
> watermark, across all the memory zones.
>
>
[-- Attachment #2: Type: text/html, Size: 1804 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: OOM at low page cache?
2015-01-28 6:26 ` Minchan Kim
2015-01-28 12:36 ` Rik van Riel
@ 2015-01-28 14:15 ` John Moser
2015-01-29 1:24 ` Minchan Kim
2015-01-28 14:27 ` John Moser
2 siblings, 1 reply; 7+ messages in thread
From: John Moser @ 2015-01-28 14:15 UTC (permalink / raw)
To: Minchan Kim, Vlastimil Babka
Cc: linux-kernel, linux-mm@kvack.org, Rik van Riel, Johannes Weiner,
KOSAKI Motohiro, Kamezawa Hiroyuki, Christoph Lameter
On 01/28/2015 01:26 AM, Minchan Kim wrote:
> Hello,
>
> On Tue, Jan 27, 2015 at 12:03:34PM +0100, Vlastimil Babka wrote:
>> CC linux-mm in case somebody has a good answer but missed this in lkml traffic
>>
>> On 01/23/2015 11:18 PM, John Moser wrote:
>>> Why is there no tunable to OOM at low page cache?
> AFAIR, there were several trial although there wasn't acceptable
> at that time. One thing I can remember is min_filelist_kbytes.
> FYI, http://lwn.net/Articles/412313/
>
That looks more straight-forward than http://lwn.net/Articles/422291/
> I'm far away from reclaim code for a long time but when I read again,
> I found something strange.
>
> With having swap in get_scan_count, we keep a mount of file LRU + free
> as above than high wmark to prevent file LRU thrashing but we don't
> with no swap. Why?
>
That's ... strange. That means having a token 1MB swap file changes the
system's practical memory reclaim behavior dramatically?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: OOM at low page cache?
2015-01-28 14:15 ` John Moser
@ 2015-01-29 1:24 ` Minchan Kim
0 siblings, 0 replies; 7+ messages in thread
From: Minchan Kim @ 2015-01-29 1:24 UTC (permalink / raw)
To: John Moser
Cc: Vlastimil Babka, linux-kernel, linux-mm@kvack.org, Rik van Riel,
Johannes Weiner, KOSAKI Motohiro, Kamezawa Hiroyuki,
Christoph Lameter
Hello,
On Wed, Jan 28, 2015 at 09:15:50AM -0500, John Moser wrote:
> On 01/28/2015 01:26 AM, Minchan Kim wrote:
> > Hello,
> >
> > On Tue, Jan 27, 2015 at 12:03:34PM +0100, Vlastimil Babka wrote:
> >> CC linux-mm in case somebody has a good answer but missed this in lkml traffic
> >>
> >> On 01/23/2015 11:18 PM, John Moser wrote:
> >>> Why is there no tunable to OOM at low page cache?
> > AFAIR, there were several trial although there wasn't acceptable
> > at that time. One thing I can remember is min_filelist_kbytes.
> > FYI, http://lwn.net/Articles/412313/
> >
>
> That looks more straight-forward than http://lwn.net/Articles/422291/
>
>
> > I'm far away from reclaim code for a long time but when I read again,
> > I found something strange.
> >
> > With having swap in get_scan_count, we keep a mount of file LRU + free
> > as above than high wmark to prevent file LRU thrashing but we don't
> > with no swap. Why?
> >
>
> That's ... strange. That means having a token 1MB swap file changes the
> system's practical memory reclaim behavior dramatically?
Basically, yes but 1M is too small. If all of swap consumed, the behavior
will be same so I think we need more explicit logic to prevent cache
thrashing. Could you test below patch?
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: OOM at low page cache?
2015-01-28 6:26 ` Minchan Kim
2015-01-28 12:36 ` Rik van Riel
2015-01-28 14:15 ` John Moser
@ 2015-01-28 14:27 ` John Moser
2 siblings, 0 replies; 7+ messages in thread
From: John Moser @ 2015-01-28 14:27 UTC (permalink / raw)
To: Minchan Kim, Vlastimil Babka
Cc: linux-kernel, linux-mm@kvack.org, Rik van Riel, Johannes Weiner,
KOSAKI Motohiro, Kamezawa Hiroyuki, Christoph Lameter
On 01/28/2015 01:26 AM, Minchan Kim wrote:
>
> Below could be band-aid until we find a elegant solution?
>
>
I don't know about elegant; but I'd be impressed if anyone figured out
how to just go Windows 95 with it and build a Task Master interface. It
would be useful to have a kernel interface that allows a service to
attach, delegate an interface program, etc., and then pull it up under
certain conditions (low memory, heavy scheduling due to lots of
fork()ing, etc.) and assign temporary high priority. Basically,
nearly-pause the system and allow the user to select and kill/term
processes, or bring a process forward (for like 10 seconds, then kick it
back again) so the user can save their work and exit gracefully. At
hard OOM, you could either OOM or pause everything (you'd need a
zero-allocation path to kill things in a user-end OOM handler).
Yeah, imaginative fantasies. Totally doable, but probably too complex
to bother. There's all kinds of semaphore inversion or some such to
worry about; how do you ensure an X11 program is 100% snappy when the
system is being thrashed by fork() bombs and memory pressure?
Actually, I have no idea what I'm talking about.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread