* GFP_FAIL?
@ 2001-09-24 19:09 Pavel Machek
2001-09-25 18:43 ` GFP_FAIL? Marcelo Tosatti
2001-09-25 19:46 ` GFP_FAIL? Tommy Reynolds
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Machek @ 2001-09-24 19:09 UTC (permalink / raw)
To: kernel list
Hi!
I need to alloc as much memory as possible, *but not more*. I do not
want to OOM-kill anything. How do I do this? Tried GFP_KERNEL, will
oom-kill. GFP_USER will OOM-kill, too.
Pavel
--
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GFP_FAIL?
2001-09-24 19:09 GFP_FAIL? Pavel Machek
@ 2001-09-25 18:43 ` Marcelo Tosatti
2001-09-25 19:46 ` GFP_FAIL? Tommy Reynolds
1 sibling, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2001-09-25 18:43 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list
On Mon, 24 Sep 2001, Pavel Machek wrote:
> Hi!
>
> I need to alloc as much memory as possible, *but not more*. I do not
> want to OOM-kill anything. How do I do this? Tried GFP_KERNEL, will
> oom-kill. GFP_USER will OOM-kill, too.
Currently, you can't.
I've added a GFP_FAIL flag at 2.4.5-ac1 to be used by the bounce buffering
allocation code to avoid highmem deadlocks, but it was removed due to no
more need.
(http://oss.sgi.com/projects/xfs/mail_archive/0103/msg00110.html is a
similar patch which I proposed to the XFS people)
The only problem by of a GFP_FAIL flag for some users is that it cannot
fail _too_ easily. Think about the SCSI layer trying to allocate big
memory chunks to do more effective (bigger) scatter-gather transfers.
If we use GFP_FAIL to mean "get memory without any efforts", the
scatter-gather big tables are never going to happen, thus we'll have
crappy performance. For _those_ kind of allocations, we want to try a bit
more instead failing so easily. See?
Thats why I think Linus will not like such a flag with no exact meaning.
Well, ask him. :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GFP_FAIL?
2001-09-24 19:09 GFP_FAIL? Pavel Machek
2001-09-25 18:43 ` GFP_FAIL? Marcelo Tosatti
@ 2001-09-25 19:46 ` Tommy Reynolds
2001-09-25 19:59 ` GFP_FAIL? Pavel Machek
1 sibling, 1 reply; 4+ messages in thread
From: Tommy Reynolds @ 2001-09-25 19:46 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-kernel
Pavel Machek <pavel@suse.cz> was pleased to say:
> Hi!
>
> I need to alloc as much memory as possible, *but not more*. I do not
> want to OOM-kill anything. How do I do this? Tried GFP_KERNEL, will
> oom-kill. GFP_USER will OOM-kill, too.
Try GFP_ATOMIC; GFP_KERNEL sets the __GFP_WAIT flag and you don't want that.
But, if you're really asking how to know how large the current working set is,
so that you don't grab more than your applications are going to need and
eventually OOM, you'll need to set GFP_HAVE_CRYSTAL_BALL ;-)
--
Tommy Reynolds |
Red Hat, Inc. (Embedded Development) | "The quickest way to do anything
307 Wynn Drive NW, Huntsville, AL 35805 USA | is right the first time."
mailto:reynolds@redhat.com | - The Lieutenant (Rick
Phone: +1.256.704.9286 | Jason), "Combat!",
Mobile: +1.919.641.2923 | 1962 TV series
FAX: +1.256.837.3839 |
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GFP_FAIL?
2001-09-25 19:46 ` GFP_FAIL? Tommy Reynolds
@ 2001-09-25 19:59 ` Pavel Machek
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2001-09-25 19:59 UTC (permalink / raw)
To: Tommy Reynolds; +Cc: Pavel Machek, linux-kernel
Hi!
> > I need to alloc as much memory as possible, *but not more*. I do not
> > want to OOM-kill anything. How do I do this? Tried GFP_KERNEL, will
> > oom-kill. GFP_USER will OOM-kill, too.
>
> Try GFP_ATOMIC; GFP_KERNEL sets the __GFP_WAIT flag and you don't
> want that.
No, I want other apps to be moved to swap, dirty data written out
etc. I really can't live with GFP_ATOMIC.
> But, if you're really asking how to know how large the current working set is,
> so that you don't grab more than your applications are going to need and
> eventually OOM, you'll need to set GFP_HAVE_CRYSTAL_BALL ;-)
I want to push just as much that I do not cause OOM. I'll stop
applications real soon after that.
Pavel
--
Causalities in World Trade Center: 6453 dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-09-25 20:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-24 19:09 GFP_FAIL? Pavel Machek
2001-09-25 18:43 ` GFP_FAIL? Marcelo Tosatti
2001-09-25 19:46 ` GFP_FAIL? Tommy Reynolds
2001-09-25 19:59 ` GFP_FAIL? Pavel Machek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.