* User mode stalls - can it be...?
@ 2000-07-05 0:54 Roger Larsson
2000-07-05 1:29 ` Roger Larsson
0 siblings, 1 reply; 4+ messages in thread
From: Roger Larsson @ 2000-07-05 0:54 UTC (permalink / raw)
To: linux-mm
Hi,
I have an idea why we get the stalls!
If we end up in a situation where our write attempts are rejected
due to lack of resources - we will continue happily with next and
next...
Count hits zero and we return
But kswapd finds out that there is more to do and calls another
shrink_mmap...
(and need_resched is not set due to lower priority)
Gives, busy wait in shrink_mmap until pages are written...
I tried to renice 15 kswapd with improved results (I am using my patched
kernels)
Another approach would be to always sleep...
/RogerL
(Sent privately to Quintela and Riel - but it might be of value for
someone else too...)
--
Home page:
http://www.norran.net/nra02596/
--
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.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: User mode stalls - can it be...?
2000-07-05 0:54 User mode stalls - can it be...? Roger Larsson
@ 2000-07-05 1:29 ` Roger Larsson
2000-07-05 13:35 ` Stephen C. Tweedie
0 siblings, 1 reply; 4+ messages in thread
From: Roger Larsson @ 2000-07-05 1:29 UTC (permalink / raw)
To: linux-mm
Roger Larsson wrote:
What about this modification (buffer.c):
static void sync_page_buffers(struct buffer_head *bh, int wait)
{
struct buffer_head * tmp = bh;
do {
struct buffer_head *p = tmp;
tmp = tmp->b_this_page;
if (buffer_locked(p)) {
if (wait)
__wait_on_buffer(p);
} else if (buffer_dirty(p))
ll_rw_block(WRITE, 1, &p);
} while (tmp != bh);
}
-to-
static void sync_page_buffers(struct buffer_head *bh, int wait)
{
struct buffer_head * tmp = bh;
do {
struct buffer_head *p = tmp;
tmp = tmp->b_this_page;
if (!buffer_locked(p) &&
buffer_dirty(p))
ll_rw_block(WRITE, 1, &p);
if (wait)
__wait_on_buffer(p);
} while (tmp != bh);
}
Not tested... (tomorrow - good night)
/RogerL
>
> Hi,
>
> I have an idea why we get the stalls!
>
> If we end up in a situation where our write attempts are rejected
> due to lack of resources - we will continue happily with next and
> next...
>
> Count hits zero and we return
>
> But kswapd finds out that there is more to do and calls another
> shrink_mmap...
> (and need_resched is not set due to lower priority)
>
> Gives, busy wait in shrink_mmap until pages are written...
>
> I tried to renice 15 kswapd with improved results (I am using my patched
> kernels)
> Another approach would be to always sleep...
>
> /RogerL
>
> (Sent privately to Quintela and Riel - but it might be of value for
> someone else too...)
>
> --
> Home page:
> http://www.norran.net/nra02596/
> --
> 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.eu.org/Linux-MM/
--
Home page:
http://www.norran.net/nra02596/
--
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.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: User mode stalls - can it be...?
2000-07-05 1:29 ` Roger Larsson
@ 2000-07-05 13:35 ` Stephen C. Tweedie
2000-07-05 19:26 ` Roger Larsson
0 siblings, 1 reply; 4+ messages in thread
From: Stephen C. Tweedie @ 2000-07-05 13:35 UTC (permalink / raw)
To: Roger Larsson; +Cc: linux-mm
Hi,
On Wed, Jul 05, 2000 at 03:29:22AM +0200, Roger Larsson wrote:
>
> static void sync_page_buffers(struct buffer_head *bh, int wait)
> {
> struct buffer_head * tmp = bh;
>
> do {
> struct buffer_head *p = tmp;
> tmp = tmp->b_this_page;
> if (!buffer_locked(p) &&
> buffer_dirty(p))
> ll_rw_block(WRITE, 1, &p);
> if (wait)
> __wait_on_buffer(p);
> } while (tmp != bh);
Yikes no. That will make the syncer wait for every single write
synchronously. It will cause a page full of 1k buffers to be written
out as four separate 1k writes instead of being streamed. This will
_kill_ performance.
Cheers,
Stephen
--
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.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: User mode stalls - can it be...?
2000-07-05 13:35 ` Stephen C. Tweedie
@ 2000-07-05 19:26 ` Roger Larsson
0 siblings, 0 replies; 4+ messages in thread
From: Roger Larsson @ 2000-07-05 19:26 UTC (permalink / raw)
To: Stephen C. Tweedie; +Cc: linux-mm
"Stephen C. Tweedie" wrote:
>
> Hi,
>
> On Wed, Jul 05, 2000 at 03:29:22AM +0200, Roger Larsson wrote:
> >
> > static void sync_page_buffers(struct buffer_head *bh, int wait)
> > {
> > struct buffer_head * tmp = bh;
> >
> > do {
> > struct buffer_head *p = tmp;
> > tmp = tmp->b_this_page;
> > if (!buffer_locked(p) &&
> > buffer_dirty(p))
> > ll_rw_block(WRITE, 1, &p);
> > if (wait)
> > __wait_on_buffer(p);
> > } while (tmp != bh);
>
> Yikes no. That will make the syncer wait for every single write
> synchronously. It will cause a page full of 1k buffers to be written
> out as four separate 1k writes instead of being streamed. This will
> _kill_ performance.
>
> Cheers,
> Stephen
Well, 'wait' is not set at each call...
But I agree that it was not a wery bright idea...
(I am more awake now :-)
/RogerL
--
Home page:
http://www.norran.net/nra02596/
--
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.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-07-05 19:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-05 0:54 User mode stalls - can it be...? Roger Larsson
2000-07-05 1:29 ` Roger Larsson
2000-07-05 13:35 ` Stephen C. Tweedie
2000-07-05 19:26 ` Roger Larsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox