linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: ditching e4b->alloc_semp
@ 2011-02-21 20:02 Amir Goldstein
  2011-02-22 17:18 ` Andreas Dilger
  2011-03-05 16:06 ` Ted Ts'o
  0 siblings, 2 replies; 11+ messages in thread
From: Amir Goldstein @ 2011-02-21 20:02 UTC (permalink / raw)
  To: Ted Ts'o; +Cc: Aneesh Kumar K.V, Ext4 Developers List

On Mon, Feb 14, 2011 at 11:22 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> On Mon, Feb 14, 2011 at 9:58 PM, Ted Ts'o <tytso@mit.edu> wrote:
>
>> One thing that comes to mind about your question with the
>> e4b->alloc_semp causing problems.  If the only reason why we need it
>> is to protect against multiple attempts to initialize different block
>> groups that share the same buddy bitmap, can we solve the problem by
>> ditching e4b->alloc_semp entirely, and simply using lock_page() on the
>> buddy bitmap page to protect it?
>>
>
> Perhaps. I imagine there is more than one elegant way to deal with that,
> but using a semaphore is not one of them.
> I will take a shot at evaporating e4b->alloc_semp.
>

After looking at the code a bit, I find that the only critical
resource that several
groups may share on a single page is the Uptodate flag, which is used
to indicate
that the buddy cache for *all* these groups is loaded
and lock_page() and get_page() are used to protect it.

There are 2 ways to eliminate this dependency:

1. (AKA easy lane) use a single page (or more) per block group.
this will increase the memory usage for 1K blocks fs and for 2K block fs
on 8K page system, but are these use cases really that common?

2. (AKA hard lane) attach buffer heads to buddy page and use
buffer_uptodate() and buffer_lock() instead of PageUptodate() and lock_page()
to initialize buddy cache of groups that share the same page.

What do you say?
Shall I take easy lane?

Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-03-21  4:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21 20:02 ditching e4b->alloc_semp Amir Goldstein
2011-02-22 17:18 ` Andreas Dilger
2011-02-22 20:02   ` Amir Goldstein
2011-02-22 21:00     ` Andreas Dilger
2011-02-23  9:54       ` Amir Goldstein
2011-03-05 16:06 ` Ted Ts'o
2011-03-06 20:15   ` Amir Goldstein
2011-03-07  4:08     ` Ted Ts'o
2011-03-07  5:52       ` Amir Goldstein
2011-03-17 16:13         ` Amir Goldstein
2011-03-21  4:39   ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).