public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* pdflush and dm-crypt
@ 2004-03-29 14:50 Zoltan NAGY
  2004-03-29 15:01 ` Jens Axboe
  2004-03-29 15:01 ` Arkadiusz Miskiewicz
  0 siblings, 2 replies; 8+ messages in thread
From: Zoltan NAGY @ 2004-03-29 14:50 UTC (permalink / raw)
  To: linux-kernel

Hi!

I've just upgraded the system to 2.6.5-rc2-bk6, and I'm using
dm-crypt. It's a heavily used server, on average 20-30mbit/sec
traffic is on the wire 7/24, and just noticed, that the load is very
high. In every 4-5 sec pdflush takes a lot of cpu... Is this
intentional? I've found a similar question on kerneltrap
(http://kerneltrap.org/node/view/2756), but havent found a solution
yet. I'm just wondering if it is a problem, or it's the normal
behavior? It's a 1.8 P4 with 1G ram and highmem enabled, with 256 bit
aes thru dm-crypt.

Regards,

--
Zoltan NAGY,
Network Administrator



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-29 14:50 pdflush and dm-crypt Zoltan NAGY
@ 2004-03-29 15:01 ` Jens Axboe
  2004-03-30  0:12   ` Andrew Morton
  2004-03-30 11:59   ` Zoltan NAGY
  2004-03-29 15:01 ` Arkadiusz Miskiewicz
  1 sibling, 2 replies; 8+ messages in thread
From: Jens Axboe @ 2004-03-29 15:01 UTC (permalink / raw)
  To: Zoltan NAGY; +Cc: linux-kernel

On Mon, Mar 29 2004, Zoltan NAGY wrote:
> Hi!
> 
> I've just upgraded the system to 2.6.5-rc2-bk6, and I'm using
> dm-crypt. It's a heavily used server, on average 20-30mbit/sec
> traffic is on the wire 7/24, and just noticed, that the load is very
> high. In every 4-5 sec pdflush takes a lot of cpu... Is this
> intentional? I've found a similar question on kerneltrap
> (http://kerneltrap.org/node/view/2756), but havent found a solution
> yet. I'm just wondering if it is a problem, or it's the normal
> behavior? It's a 1.8 P4 with 1G ram and highmem enabled, with 256 bit
> aes thru dm-crypt.

Try the -mm kernels intead, should have lots better behaviour for
pdflush/dm interactions.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-29 14:50 pdflush and dm-crypt Zoltan NAGY
  2004-03-29 15:01 ` Jens Axboe
@ 2004-03-29 15:01 ` Arkadiusz Miskiewicz
  1 sibling, 0 replies; 8+ messages in thread
From: Arkadiusz Miskiewicz @ 2004-03-29 15:01 UTC (permalink / raw)
  To: linux-kernel

Dnia Monday 29 of March 2004 16:50, Zoltan NAGY napisał:

> I've just upgraded the system to 2.6.5-rc2-bk6, and I'm using
> dm-crypt. It's a heavily used server, on average 20-30mbit/sec
> traffic is on the wire 7/24, and just noticed, that the load is very
> high. In every 4-5 sec pdflush takes a lot of cpu... Is this
> intentional? I've found a similar question on kerneltrap
> (http://kerneltrap.org/node/view/2756), but havent found a solution
> yet. I'm just wondering if it is a problem, or it's the normal
> behavior? It's a 1.8 P4 with 1G ram and highmem enabled, with 256 bit
> aes thru dm-crypt.
Same here (duron 1.2GHz, 512MB ram, IDE disks (via and promise controllers)) 
and it doesn't matter if I'm using cryptoloop or dm-crypt. 

System hangs for about one seconds (xmms stops playing, xterms are not 
responding to key presses) and then everything back to normal until next hang 
happens (in few seconds).

> Zoltan NAGY,
> Network Administrator

ps. I'm not sure (didn't do any checking to be sure) but afaik this started to 
happening with 2.6.3 kernel.
-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-29 15:01 ` Jens Axboe
@ 2004-03-30  0:12   ` Andrew Morton
  2004-03-30  6:22     ` Jens Axboe
  2004-03-30  9:46     ` Christophe Saout
  2004-03-30 11:59   ` Zoltan NAGY
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2004-03-30  0:12 UTC (permalink / raw)
  To: Jens Axboe; +Cc: nagyz, linux-kernel

Jens Axboe <axboe@suse.de> wrote:
>
> On Mon, Mar 29 2004, Zoltan NAGY wrote:
> > Hi!
> > 
> > I've just upgraded the system to 2.6.5-rc2-bk6, and I'm using
> > dm-crypt. It's a heavily used server, on average 20-30mbit/sec
> > traffic is on the wire 7/24, and just noticed, that the load is very
> > high. In every 4-5 sec pdflush takes a lot of cpu... Is this
> > intentional? I've found a similar question on kerneltrap
> > (http://kerneltrap.org/node/view/2756), but havent found a solution
> > yet. I'm just wondering if it is a problem, or it's the normal
> > behavior? It's a 1.8 P4 with 1G ram and highmem enabled, with 256 bit
> > aes thru dm-crypt.
> 
> Try the -mm kernels intead, should have lots better behaviour for
> pdflush/dm interactions.
> 

How come?  Isn't this problem just "gee, we have a lot of stuff to encrypt
during writeback"?  If so, then it should be sufficient to poke a hole in
the encryption loop?

--- 25/drivers/md/dm-crypt.c~a	Mon Mar 29 16:11:49 2004
+++ 25-akpm/drivers/md/dm-crypt.c	Mon Mar 29 16:11:56 2004
@@ -669,6 +669,7 @@ static int crypt_map(struct dm_target *t
 		/* out of memory -> run queues */
 		if (remaining)
 			blk_congestion_wait(bio_data_dir(clone), HZ/100);
+		cond_resched();
 	}
 
 	/* drop reference, clones could have returned before we reach this */

_


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-30  0:12   ` Andrew Morton
@ 2004-03-30  6:22     ` Jens Axboe
  2004-03-30  9:46     ` Christophe Saout
  1 sibling, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2004-03-30  6:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: nagyz, linux-kernel

On Mon, Mar 29 2004, Andrew Morton wrote:
> Jens Axboe <axboe@suse.de> wrote:
> >
> > On Mon, Mar 29 2004, Zoltan NAGY wrote:
> > > Hi!
> > > 
> > > I've just upgraded the system to 2.6.5-rc2-bk6, and I'm using
> > > dm-crypt. It's a heavily used server, on average 20-30mbit/sec
> > > traffic is on the wire 7/24, and just noticed, that the load is very
> > > high. In every 4-5 sec pdflush takes a lot of cpu... Is this
> > > intentional? I've found a similar question on kerneltrap
> > > (http://kerneltrap.org/node/view/2756), but havent found a solution
> > > yet. I'm just wondering if it is a problem, or it's the normal
> > > behavior? It's a 1.8 P4 with 1G ram and highmem enabled, with 256 bit
> > > aes thru dm-crypt.
> > 
> > Try the -mm kernels intead, should have lots better behaviour for
> > pdflush/dm interactions.
> > 
> 
> How come?  Isn't this problem just "gee, we have a lot of stuff to encrypt
> during writeback"?  If so, then it should be sufficient to poke a hole in
> the encryption loop?

If that is the problem, then yeah that'd work. I was assuming the 'load'
was just io load and pdflush got stuck on them.

> --- 25/drivers/md/dm-crypt.c~a	Mon Mar 29 16:11:49 2004
> +++ 25-akpm/drivers/md/dm-crypt.c	Mon Mar 29 16:11:56 2004
> @@ -669,6 +669,7 @@ static int crypt_map(struct dm_target *t
>  		/* out of memory -> run queues */
>  		if (remaining)
>  			blk_congestion_wait(bio_data_dir(clone), HZ/100);
> +		cond_resched();
>  	}

Reminds me, we have to kill that blk_congestion_wait() stuff too.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-30  0:12   ` Andrew Morton
  2004-03-30  6:22     ` Jens Axboe
@ 2004-03-30  9:46     ` Christophe Saout
  2004-03-30 10:07       ` Andrew Morton
  1 sibling, 1 reply; 8+ messages in thread
From: Christophe Saout @ 2004-03-30  9:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jens Axboe, nagyz, linux-kernel

Am Mo, den 29.03.2004, um 16:12 Uhr -0800, schrieb Andrew Morton:

> How come?  Isn't this problem just "gee, we have a lot of stuff to encrypt
> during writeback"?  If so, then it should be sufficient to poke a hole in
> the encryption loop?
> 
> --- 25/drivers/md/dm-crypt.c~a	Mon Mar 29 16:11:49 2004
> +++ 25-akpm/drivers/md/dm-crypt.c	Mon Mar 29 16:11:56 2004
> @@ -669,6 +669,7 @@ static int crypt_map(struct dm_target *t
>  		/* out of memory -> run queues */
>  		if (remaining)
>  			blk_congestion_wait(bio_data_dir(clone), HZ/100);
> +		cond_resched();
>  	}
>  
>  	/* drop reference, clones could have returned before we reach this */

cryptoapi always does this after every block. It also happens with
preemption enabled. I got feedback from a person who said that renicing
pdflush to 0 helped. So it looks like the CPU scheduler doesn't want to
schedule pdflush away. Hmm.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-30  9:46     ` Christophe Saout
@ 2004-03-30 10:07       ` Andrew Morton
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2004-03-30 10:07 UTC (permalink / raw)
  To: Christophe Saout; +Cc: axboe, nagyz, linux-kernel

Christophe Saout <christophe@saout.de> wrote:
>
> Am Mo, den 29.03.2004, um 16:12 Uhr -0800, schrieb Andrew Morton:
> 
>  > How come?  Isn't this problem just "gee, we have a lot of stuff to encrypt
>  > during writeback"?  If so, then it should be sufficient to poke a hole in
>  > the encryption loop?
>  > 
>  > --- 25/drivers/md/dm-crypt.c~a	Mon Mar 29 16:11:49 2004
>  > +++ 25-akpm/drivers/md/dm-crypt.c	Mon Mar 29 16:11:56 2004
>  > @@ -669,6 +669,7 @@ static int crypt_map(struct dm_target *t
>  >  		/* out of memory -> run queues */
>  >  		if (remaining)
>  >  			blk_congestion_wait(bio_data_dir(clone), HZ/100);
>  > +		cond_resched();
>  >  	}
>  >  
>  >  	/* drop reference, clones could have returned before we reach this */
> 
>  cryptoapi always does this after every block. It also happens with
>  preemption enabled. I got feedback from a person who said that renicing
>  pdflush to 0 helped. So it looks like the CPU scheduler doesn't want to
>  schedule pdflush away. Hmm.

Oh, OK, since pdflush was converted to use the kthread stuff it has been
running at keventd's `nice -10'.  You can probably renice it by hand.



diff -puN mm/pdflush.c~pdflush-nice-0 mm/pdflush.c
--- 25/mm/pdflush.c~pdflush-nice-0	2004-03-30 01:59:17.795116816 -0800
+++ 25-akpm/mm/pdflush.c	2004-03-30 02:02:29.865917616 -0800
@@ -177,6 +177,12 @@ static int __pdflush(struct pdflush_work
 static int pdflush(void *dummy)
 {
 	struct pdflush_work my_work;
+
+	/*
+	 * pdflush can spend a lot of time doing encryption via dm-crypt.  We
+	 * don't want to do that at keventd's priority.
+	 */
+	set_user_nice(current, 0);
 	return __pdflush(&my_work);
 }
 

_


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pdflush and dm-crypt
  2004-03-29 15:01 ` Jens Axboe
  2004-03-30  0:12   ` Andrew Morton
@ 2004-03-30 11:59   ` Zoltan NAGY
  1 sibling, 0 replies; 8+ messages in thread
From: Zoltan NAGY @ 2004-03-30 11:59 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, akpm

Hello Jens,

> Try the -mm kernels intead, should have lots better behaviour for
> pdflush/dm interactions.

allright. with -mm5 it is _much_ better. load is back to normal. I
suppose we should get all this stuff into mainline ASAP ;) I'm sure
lot of people are using this combo.

thanks for you help,

--
Zoltan NAGY,
Network Administrator




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-30 11:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-29 14:50 pdflush and dm-crypt Zoltan NAGY
2004-03-29 15:01 ` Jens Axboe
2004-03-30  0:12   ` Andrew Morton
2004-03-30  6:22     ` Jens Axboe
2004-03-30  9:46     ` Christophe Saout
2004-03-30 10:07       ` Andrew Morton
2004-03-30 11:59   ` Zoltan NAGY
2004-03-29 15:01 ` Arkadiusz Miskiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox