mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: j-nomura@ce.jp.nec.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.18: lru_list_lock contention in write_unlocked_buffers()
Date: Wed, 2 Apr 2003 00:23:17 -0800	[thread overview]
Message-ID: <20030402002317.5bb07d11.akpm@digeo.com> (raw)
In-Reply-To: <20030402.165044.576024545.nomura@hpc.bs1.fc.nec.co.jp>

j-nomura@ce.jp.nec.com wrote:
>
> Hello,
> 
> when I run mkfs while doing other large file I/O in parallel,
> the system response becomes terribly bad on 2.4.18 kernel.
> (probably on other 2.4 kernels also)
> 
> I found there are hard contention on lru_list_lock, which is mostly held
> by write_unlocked_buffers().
> It happens only on large memory machine because lru_list can grow very long
> and write_some_buffers() scans the long list from head on each call.
> 
> Lowlatency patch in aa tree did not help this situation.
> 
> The patch below is hasty workaround for it.
> Any comments, or suggestions to better fix?
> 

I don't think there's a sane fix for this in the 2.4 context.

What you can do is to convert fsync_dev() to sync _all_ devices and not just
the one which is being closed.

It will take longer, but it converts the O(n*n) search into O(n).

diff -puN fs/buffer.c~a fs/buffer.c
--- 24/fs/buffer.c~a	2003-04-02 00:21:39.000000000 -0800
+++ 24-akpm/fs/buffer.c	2003-04-02 00:21:51.000000000 -0800
@@ -343,6 +343,7 @@ int fsync_no_super(kdev_t dev)
 
 int fsync_dev(kdev_t dev)
 {
+	dev = NODEV;
 	sync_buffers(dev, 0);
 
 	lock_kernel();

_


  reply	other threads:[~2003-04-02  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-02  7:50 j-nomura
2003-04-02  8:23 ` Andrew Morton [this message]
2003-04-03 11:57   ` j-nomura

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=20030402002317.5bb07d11.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®