Re: [dm-devel] Linux 2.6.36-rc7

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Torsten Kaiser
Date: Sunday, October 10, 2010 - 4:56 am

On Fri, Oct 8, 2010 at 7:02 PM, Tejun Heo <tj@kernel.org> wrote:

I instrument mm/mempool.c, trying to find what shared pool gets exhausted.
On the last run, it seemed that the fs_bio_set from fs/bio.c runs dry.

As far as I can see, that pool is used by bio_alloc() and bio_clone().
Above bio_alloc() a dire warning says, that any bio allocated that way
needs to be submitted from IO, otherwise the system could livelock.
bio_clone() does not have this warning, but as it uses the same pool
in the same way, I would expect the same rule applies.

Looking for uses of bio_allow() and bio_clone() in drivers/md it looks
like dm-crypt uses its own pools and not the fs_bio_set.
But drivers/md/raid1.c uses this pool, and in my eyes it does it wrong.

When writing to a RAID1 array the function make_request() in raid1.c
does a bio_clone() for each drive (lines 967-1001 in 2.6.36-rc7) and
only after all bios are allocates they will be merged into the
pending_bio_list.

So a RAID1 with 3 mirrors is a sure way to lock up a system as soon as
the mempool is needed?
(The fs_bio_set pool only allocates BIO_POOL_SIZE entries and that is
defined as 2)

From the use of atomic_inc(&r1_bio->remaining) and the use of the
spin_lock_irqsave(&conf->device_lock, flags) when merging the bio
list, I would suspect that its even possible that multiple CPUs
concurrently get into this allocation loop, or that the use of
multiple RAID1 devices each with only 2 drives could lock up the same
way.

What am I missing, or is the use of bio_clone() really the wrong thing?

Torsten
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.36-rc7, Linus Torvalds, (Wed Oct 6, 2:45 pm)
Re: Linux 2.6.36-rc7, Stephen Rothwell, (Wed Oct 6, 5:49 pm)
Re: Linux 2.6.36-rc7, Tvrtko Ursulin, (Thu Oct 7, 9:10 am)
Re: Linux 2.6.36-rc7, Tvrtko Ursulin, (Thu Oct 7, 10:15 am)
Re: Linux 2.6.36-rc7, Eric Paris, (Thu Oct 7, 10:33 am)
Re: Linux 2.6.36-rc7, Eric Paris, (Thu Oct 7, 10:49 am)
Re: Linux 2.6.36-rc7, Alan Cox, (Thu Oct 7, 11:07 am)
Re: Linux 2.6.36-rc7, Tejun Heo, (Thu Oct 7, 12:28 pm)
Re: [dm-devel] Linux 2.6.36-rc7, Milan Broz, (Thu Oct 7, 1:13 pm)
Re: Linux 2.6.36-rc7, John Stoffel, (Thu Oct 7, 1:55 pm)
Re: Linux 2.6.36-rc7, Eric Paris, (Thu Oct 7, 2:24 pm)
Re: Linux 2.6.36-rc7, Andreas Gruenbacher, (Fri Oct 8, 5:06 am)
Re: Linux 2.6.36-rc7, James Bottomley, (Fri Oct 8, 8:05 am)
Re: Linux 2.6.36-rc7, John Stoffel, (Fri Oct 8, 8:42 am)
Re: Linux 2.6.36-rc7, Tvrtko Ursulin, (Fri Oct 8, 9:17 am)
Re: Linux 2.6.36-rc7, Eric Paris, (Fri Oct 8, 9:38 am)
Re: Linux 2.6.36-rc7, Eric Paris, (Fri Oct 8, 9:41 am)
Re: Linux 2.6.36-rc7, John Stoffel, (Fri Oct 8, 9:54 am)
Re: [dm-devel] Linux 2.6.36-rc7, Tejun Heo, (Fri Oct 8, 10:02 am)
Re: Linux 2.6.36-rc7, Andreas Gruenbacher, (Fri Oct 8, 2:03 pm)
Re: Linux 2.6.36-rc7, Andreas Gruenbacher, (Fri Oct 8, 2:45 pm)
Re: Linux 2.6.36-rc7, Andreas Gruenbacher, (Fri Oct 8, 2:50 pm)
Re: Linux 2.6.36-rc7, H. Peter Anvin, (Fri Oct 8, 2:59 pm)
Re: Linux 2.6.36-rc7, John Stoffel, (Fri Oct 8, 5:46 pm)
Re: [dm-devel] Linux 2.6.36-rc7, Torsten Kaiser, (Sun Oct 10, 4:56 am)
fanotify: disable fanotify syscalls, Eric Paris, (Mon Oct 11, 3:13 pm)
Re: Linux 2.6.36-rc7, Tvrtko Ursulin, (Mon Oct 18, 4:01 am)