xfs
[Top] [All Lists]

Re: grab_cache_page deadlock | was Re: set_buffer_dirty_uptodate

To: Marcelo Tosatti <marcelo@xxxxxxxxxxxxxxxx>
Subject: Re: grab_cache_page deadlock | was Re: set_buffer_dirty_uptodate
From: Andrea Arcangeli <andrea@xxxxxxx>
Date: Fri, 29 Dec 2000 18:44:44 +0100
Cc: Andi Kleen <ak@xxxxxxx>, Rajagopal Ananthanarayanan <ananth@xxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.21.0012291301070.13063-100000@freak.distro.conectiva>; from marcelo@conectiva.com.br on Fri, Dec 29, 2000 at 01:07:37PM -0200
References: <20001228220353.A24415@gruyere.muc.suse.de> <Pine.LNX.4.21.0012291301070.13063-100000@freak.distro.conectiva>
Sender: owner-linux-xfs@xxxxxxxxxxx
Hello!

On Fri, Dec 29, 2000 at 01:07:37PM -0200, Marcelo Tosatti wrote:
> Basically what Andrea did in 2.2 was to add a "has_io_locks" flag to the
> task_struct structure which indicates if the current process has any fs
> lock held. (the flag is increased when any fs lock is taken, and decreased
> when any fs lock is unlocked)
> 
> With this scheme its possible to not sleep on kswapd if we have
> "current->has_io_locks" > 0 and avoid the deadlock. 

Correct.

However I don't see why somebody is waiting for kswapd in first place ;). I see
kswapd only as a background thing, nothing should need to wait for kswapd to
finish. Every time we can block and we're under a certain min watermark we'd
better do the work ourselfs instead of waiting progress from kswapd (this
has performance advantage since it at first avoids the reschedule overhead).
If we're not under such min watermark but the system is low on memory kswapd
can free some memory in background (in parallel in SMP) and we don't need to
wait its completion either (or we would serialize the work).

Andrea

<Prev in Thread] Current Thread [Next in Thread>