xfs
[Top] [All Lists]

Re: [xfs-masters] swsusp vs. xfs [was Re: 2.6.12-rc2-mm1]

To: Pavel Machek <pavel@xxxxxxx>
Subject: Re: [xfs-masters] swsusp vs. xfs [was Re: 2.6.12-rc2-mm1]
From: Nathan Scott <nathans@xxxxxxx>
Date: Tue, 12 Apr 2005 10:26:03 +1000
Cc: "Barry K. Nathan" <barryn@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, hare@xxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <20050411235110.GA2472@xxxxxxxxxx>
References: <20050407030614.GA7583@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050408103327.GD1392@xxxxxxxxxx> <20050410211808.GA12118@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050410212747.GB26316@xxxxxxxxxx> <20050410225708.GB12118@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050410230053.GD12794@xxxxxxxxxx> <20050411043124.GA24626@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050411105759.GB1373@xxxxxxxxxx> <20050411231213.GD702@frodo> <20050411235110.GA2472@xxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.3i
On Tue, Apr 12, 2005 at 01:51:10AM +0200, Pavel Machek wrote:
> I should take some sleep now, so I can't test the patch, but I don't
> think it will help. If someone has PF_FREEZE set, he should be in
> refrigerator.

OK, so if that doesn't help, here's an alternate approach - this
lets xfsbufd track when its entering the refrigerator(), so that
other callers know that attempts to wake it are futile.

cheers.

-- 
Nathan


--- fs/xfs/linux-2.6/xfs_buf.c.orig     2005-04-12 09:00:26.375351560 +1000
+++ fs/xfs/linux-2.6/xfs_buf.c  2005-04-12 10:14:27.468202824 +1000
@@ -1746,13 +1746,15 @@ STATIC DECLARE_COMPLETION(pagebuf_daemon
 STATIC struct task_struct *pagebuf_daemon_task;
 STATIC int pagebuf_daemon_active;
 STATIC int force_flush;
-
+STATIC int force_sleep;
 
 STATIC int
 pagebuf_daemon_wakeup(
        int                     priority,
        unsigned int            mask)
 {
+       if (force_sleep)
+               return 0;
        force_flush = 1;
        barrier();
        wake_up_process(pagebuf_daemon_task);
@@ -1778,7 +1780,12 @@ pagebuf_daemon(
 
        INIT_LIST_HEAD(&tmp);
        do {
-               try_to_freeze(PF_FREEZE);
+               if (unlikely(current->flags & PF_FREEZE)) {
+                       force_sleep = 1;
+                       refrigerator(PF_FREEZE);
+               } else {
+                       force_sleep = 0;
+               }
 
                set_current_state(TASK_INTERRUPTIBLE);
                schedule_timeout((xfs_buf_timer_centisecs * HZ) / 100);


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