From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [dm-devel] [PATCH] dm: noflush resizing (0/3)
Date: Thu, 25 Oct 2007 14:46:17 -0400 [thread overview]
Message-ID: <4720E479.4020906@ce.jp.nec.com> (raw)
In-Reply-To: <20071025144833.GN10006@agk.fab.redhat.com>
Hi Alasdair,
Thanks for the immediate reply.
So as far as I understand, the point is:
1. it's preferable to resize inode after the resume, if possible
2. it's necessary to have nowait version of bdget() to avoid stall
For the 1st item, I guess the reason is that we want to make the
table swapping code deterministic. Is it correct?
Even if we don't have to wait for bdget(), you like to have the resizing
code after the resume?
For the 2nd item, the patch included bdlookup() for that purpose.
What do you think about it?
I added below some additional comments and questions.
Alasdair G Kergon wrote:
> On Thu, Oct 25, 2007 at 10:18:02AM -0400, Jun'ichi Nomura wrote:
>> There is no guarantee that the I/O flowing through the device again.
>> The table might need be replaced again, but to do that, the resume
>> should have been completed to let the userspace know it.
>
> Then the first attempt to set the size could be made to fail
> (because it could not get the lock immediately) and the
> size could be set after the second resume instead.
>
> - Setting the size would lag behind the actual size the dm table was
> supporting, but (given the usage cases discussed) this would not matter.
>
>> bdget() in noflush suspend has a possibility of stall.
>
> So we cannot avoid fixing that: we require immediate return
> with failure instead of waiting.
bdlookup() is the almost nowait version of bdget()
("almost" means it may wait for I_NEW turned off in case there is
bdget() doing its latter half. But it never stalls.)
Do you think we need something else?
>> OTOH, calling bdget() and i_size_write() outside of the lock
>> can cause race with other table swapping and may result in setting
>> wrong device size.
>
> If the size setting is removed from the lock, then it becomes
> "set the inode size to match the current size of the table" and
> races would not matter - each "set size" attempt would set it
> to the instantaneous live table size, not a cached value that
> could be out-of-date.
Even though, I think we still want set_capacity() during the table
swapping. So we need to call dm_table_get_size() twice. Is it ok?
Also, do you want to move the resizing code for normal suspend, too?
Otherwise, the code will be duplicated and I don't think you like it.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
next prev parent reply other threads:[~2007-10-25 18:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 21:25 [PATCH] dm: noflush resizing (0/3) Jun'ichi Nomura
2007-10-25 1:24 ` [dm-devel] " Alasdair G Kergon
2007-10-25 14:18 ` Jun'ichi Nomura
2007-10-25 14:48 ` Alasdair G Kergon
2007-10-25 18:46 ` Jun'ichi Nomura [this message]
2007-10-25 23:51 ` Jun'ichi Nomura
2007-10-26 0:37 ` Alasdair G Kergon
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=4720E479.4020906@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=dm-devel@redhat.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