linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Jens Axboe <axboe@kernel.dk>,
	Tahsin Erdogan <tahsin@google.com>,
	cgroups@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>,
	Nauman Rafique <nauman@google.com>,
	linux-kernel@vger.kernel.org, Jan Kara <jack@suse.com>
Subject: Re: [PATCH block/for-4.5-fixes] writeback: keep superblock pinned during cgroup writeback association switches
Date: Wed, 17 Feb 2016 23:30:09 +0100	[thread overview]
Message-ID: <20160217223009.GN14140@quack.suse.cz> (raw)
In-Reply-To: <20160217210744.GA6479@mtj.duckdns.org>

On Wed 17-02-16 16:07:44, Tejun Heo wrote:
> Hello, Jan.
> 
> On Wed, Feb 17, 2016 at 09:57:21PM +0100, Jan Kara wrote:
> > Well, but this has the side-effect that trying to umount a filesystem while
> > migrations are happening will result in EBUSY error. Without obvious reason
> > why that happens. As an admin I would be rather upset when umount sometimes
> > returns EBUSY without apparent reason and you have to basically implement a
> > loop around umount to make it reliable. So a nack from me for this patch.
> 
> I see.  Can you please point me to the s_active check during umount?
> I first tried s_umount but couldn't transfer its ownership to the
> worker so ended up doing s_active.  I looked at how s_active is used
> and couldn't find where it'd block umount.  may_umount() checks
> mnt_count, not s_active, so it looked like holding s_active may delay
> destruction of the superblock but not prevent umount.

Bah, sorry. It's too late here. You are right that s_active will just delay
destruction of the superblock until the reference is dropped. So I don't
see obvious issues with what you do and I retract my nack. I still feel
somewhat uneasy about postponing fs shutdown to a workqueue like this but
hopefully there's no hidden catch.

								Honza


> > Traditionally, we have used sb->s_count and sb->s_umount semaphore to pin
> > superblock while writeback code was working on it. That makes umount block
> > until we can safely unmount the filesystem and thus doesn't result in these
> > spurious EBUSY errors. But from a quick look this can be problematic for the
> > cgroup setting.
> > 
> > Alternatively, you could either cancel all the switching work when
> > unmounting filesystem or maybe just handle I_WB_SWITCH similarly to I_SYNC
> > - don't grab inode reference when switching is going on, just make
> > I_WB_SWITCH pin the inode and wait in evict() for it to be clear (similarly
> > as we call inode_wait_for_writeback() there).
> 
> Yeah, this is an alternative but likely more involved.
> 
> Thanks.
> 
> -- 
> tejun
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2016-02-17 22:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAeU0aNCq7LGODvVGRU-oU_o-6enii5ey0p1c26D1ZzYwkDc5A@mail.gmail.com>
     [not found] ` <20160215210047.GN3965@htj.duckdns.org>
     [not found]   ` <CAAeU0aNAd1Ra6LXmWwq8row4MD_BpVHiSXOwHx07m86UWREvHw@mail.gmail.com>
2016-02-16 18:24     ` [PATCH block/for-4.5-fixes] writeback: keep superblock pinned during cgroup writeback association switches Tejun Heo
2016-02-16 18:34       ` Jens Axboe
2016-02-17 20:57       ` Jan Kara
2016-02-17 21:07         ` Tejun Heo
2016-02-17 22:30           ` Jan Kara [this message]
2016-02-17 22:41             ` Tahsin Erdogan
2016-02-17 23:02               ` Tejun Heo
2016-02-18  9:55                 ` Jan Kara
2016-02-18 13:00                   ` Tejun Heo
2016-02-18 13:20                     ` Jan Kara
2016-02-19 20:18                     ` Al Viro
2016-02-19 20:51                       ` Tejun Heo
2016-02-19 21:58                         ` Al Viro
2016-02-19 22:15                           ` Tejun Heo
2016-02-19 22:26                             ` Al Viro
2016-02-28 21:53                               ` Tejun Heo
2016-02-29 20:47                 ` [PATCH block/for-linus] writeback: flush inode cgroup wb switches instead of pinning super_block Tejun Heo
2016-02-29 20:54                   ` Al Viro
2016-02-29 20:58                     ` Tejun Heo
2016-02-29 21:06                       ` Al Viro
2016-02-29 21:08                         ` Tejun Heo
2016-02-29 21:21                           ` Jan Kara
2016-02-29 23:28                   ` [PATCH v2 " Tejun Heo
2016-03-01  9:20                     ` Jan Kara
2016-03-01 17:46                     ` Jens Axboe
2016-03-01 17:50                       ` Tejun Heo
2016-03-02 10:29                         ` Jan Kara
2016-03-01 13:39                   ` [PATCH " Tahsin Erdogan
2016-02-18 10:12       ` [PATCH block/for-4.5-fixes] writeback: keep superblock pinned during cgroup writeback association switches Nikolay Borisov
2016-02-18 12:57         ` Tejun Heo

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=20160217223009.GN14140@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=jack@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nauman@google.com \
    --cc=tahsin@google.com \
    --cc=tj@kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).