mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Christophe Saout <christophe@saout.de>
Cc: axboe@suse.de, nagyz@nefty.hu, linux-kernel@vger.kernel.org
Subject: Re: pdflush and dm-crypt
Date: Tue, 30 Mar 2004 02:07:56 -0800	[thread overview]
Message-ID: <20040330020756.20705731.akpm@osdl.org> (raw)
In-Reply-To: <1080639971.7152.7.camel@leto.cs.pocnet.net>

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);
 }
 

_


  reply	other threads:[~2004-03-30 10:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 14:50 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 [this message]
2004-03-30 11:59   ` Zoltan NAGY
2004-03-29 15:01 ` Arkadiusz Miskiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040330020756.20705731.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=christophe@saout.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nagyz@nefty.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®