* [PATCHSET block/for-4.2/writeback] ext4: implement cgroup writeback support @ 2015-06-12 22:02 Tejun Heo 2015-06-12 22:02 ` [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc Tejun Heo 2015-06-12 22:02 ` [PATCH 2/2] ext4: implement cgroup writeback support Tejun Heo 0 siblings, 2 replies; 18+ messages in thread From: Tejun Heo @ 2015-06-12 22:02 UTC (permalink / raw) To: axboe-tSWWG44O7X1aa/9Udqfwiw Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, tytso-3s7WtUTddSA, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, linux-ext4-u79uwXL29TY76Z2rM5mHXA Hello, This patchset implements cgroup writeback support for ext4, which is enabled for writeback and ordered data modes. This patchset contains the following two patches. 0001-ext4-replace-ext4_io_submit-io_op-with-io_wbc.patch 0002-ext4-implement-cgroup-writeback-support.patch 0001 is a prep patch which replaces io_submit->io_op w/ ->io_wbc. 0002 implements cgroup writeback support. This patchset is on top of [1] block/for-4.2/writeback +[2] [PATCHSET] cgroup, writeback: misc updates for cgroup writeback support and available on in the following git branch. git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup-writeback-ext4 diffstat follows. Thanks. fs/ext4/ext4.h | 2 +- fs/ext4/page-io.c | 8 ++++++-- fs/ext4/super.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) -- tejun [1] git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-4.2/writeback [2] http://lkml.kernel.org/g/1434146254-26220-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc 2015-06-12 22:02 [PATCHSET block/for-4.2/writeback] ext4: implement cgroup writeback support Tejun Heo @ 2015-06-12 22:02 ` Tejun Heo 2015-06-12 22:02 ` [PATCH 2/2] ext4: implement cgroup writeback support Tejun Heo 1 sibling, 0 replies; 18+ messages in thread From: Tejun Heo @ 2015-06-12 22:02 UTC (permalink / raw) To: axboe Cc: linux-kernel, linux-fsdevel, lizefan, cgroups, tytso, adilger.kernel, linux-ext4, Tejun Heo ext4_io_submit_init() takes the pointer to writeback_control to test its sync_mode and determine between WRITE and WRITE_SYNC and records the result in ->io_op. This patch makes it record the pointer directly and moves the test to ext4_io_submit(). This doesn't cause any noticeable differences now but having writeback_control available throughout IO submission path will be depended upon by the planned cgroup writeback support. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: linux-ext4@vger.kernel.org --- fs/ext4/ext4.h | 2 +- fs/ext4/page-io.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 009a059..74a4923 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -191,7 +191,7 @@ typedef struct ext4_io_end { } ext4_io_end_t; struct ext4_io_submit { - int io_op; + struct writeback_control *io_wbc; struct bio *io_bio; ext4_io_end_t *io_end; sector_t io_next_block; diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index c5d81e8..3f80cb2 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -357,8 +357,10 @@ void ext4_io_submit(struct ext4_io_submit *io) struct bio *bio = io->io_bio; if (bio) { + int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ? + WRITE_SYNC : WRITE; bio_get(io->io_bio); - submit_bio(io->io_op, io->io_bio); + submit_bio(io_op, io->io_bio); bio_put(io->io_bio); } io->io_bio = NULL; @@ -367,7 +369,7 @@ void ext4_io_submit(struct ext4_io_submit *io) void ext4_io_submit_init(struct ext4_io_submit *io, struct writeback_control *wbc) { - io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + io->io_wbc = wbc; io->io_bio = NULL; io->io_end = NULL; } -- 2.4.2 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/2] ext4: implement cgroup writeback support 2015-06-12 22:02 [PATCHSET block/for-4.2/writeback] ext4: implement cgroup writeback support Tejun Heo 2015-06-12 22:02 ` [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc Tejun Heo @ 2015-06-12 22:02 ` Tejun Heo 1 sibling, 0 replies; 18+ messages in thread From: Tejun Heo @ 2015-06-12 22:02 UTC (permalink / raw) To: axboe Cc: linux-kernel, linux-fsdevel, lizefan, cgroups, tytso, adilger.kernel, linux-ext4, Tejun Heo For ordered and writeback data modes, all data IOs go through ext4_io_submit. This patch adds cgroup writeback support by invoking wbc_init_bio() from io_submit_init_bio() and wbc_account_io() in io_submit_add_bh(). Journal data which is written by jbd2 worker is left alone by this patch and will always be written out from the root cgroup. ext4_fill_super() is updated to set MS_CGROUPWB when data mode is either ordered or writeback. In journaled data mode, most IOs become synchronous through the journal and enabling cgroup writeback support doesn't make much sense or difference. Journaled data mode is left alone. Lightly tested with sequential data write workload. Behaves as expected. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: linux-ext4@vger.kernel.org --- fs/ext4/page-io.c | 2 ++ fs/ext4/super.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 3f80cb2..c56ba7b 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -383,6 +383,7 @@ static int io_submit_init_bio(struct ext4_io_submit *io, bio = bio_alloc(GFP_NOIO, min(nvecs, BIO_MAX_PAGES)); if (!bio) return -ENOMEM; + wbc_init_bio(io->io_wbc, bio); bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); bio->bi_bdev = bh->b_bdev; bio->bi_end_io = ext4_end_bio; @@ -411,6 +412,7 @@ static int io_submit_add_bh(struct ext4_io_submit *io, ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh)); if (ret != bh->b_size) goto submit_and_retry; + wbc_account_io(io->io_wbc, page, bh->b_size); io->io_next_block++; return 0; } diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 56b8bb7..a9a3de3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3623,6 +3623,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } if (test_opt(sb, DELALLOC)) clear_opt(sb, DELALLOC); + } else { + sb->s_flags |= MS_CGROUPWB; } sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | -- 2.4.2 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCHSET v2 block/for-4.2/writeback] ext4: implement cgroup writeback support @ 2015-06-16 22:53 Tejun Heo 2015-06-16 22:53 ` [PATCH 2/2] " Tejun Heo 0 siblings, 1 reply; 18+ messages in thread From: Tejun Heo @ 2015-06-16 22:53 UTC (permalink / raw) To: axboe-tSWWG44O7X1aa/9Udqfwiw Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w, kernel-team-b10kYP2dOMg, tytso-3s7WtUTddSA, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, linux-ext4-u79uwXL29TY76Z2rM5mHXA Hello, This is v2. The only change from the last take[L] is * Updated to reflect the earlier MS_CGROUPWB -> SB_I_CGROUPWB change. This patchset implements cgroup writeback support for ext4, which is enabled for writeback and ordered data modes. This patchset contains the following two patches. 0001-ext4-replace-ext4_io_submit-io_op-with-io_wbc.patch 0002-ext4-implement-cgroup-writeback-support.patch 0001 is a prep patch which replaces io_submit->io_op w/ ->io_wbc. 0002 implements cgroup writeback support. This patchset is on top of [1] block/for-4.2/writeback +[2] [PATCHSET] cgroup, writeback: misc updates for cgroup writeback support and available on in the following git branch. git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup-writeback-ext4 diffstat follows. Thanks. fs/ext4/ext4.h | 2 +- fs/ext4/page-io.c | 8 ++++++-- fs/ext4/super.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) -- tejun [L] http://lkml.kernel.org/g/1434146543-26358-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org [1] git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-4.2/writeback [2] http://lkml.kernel.org/g/1434494912-31043-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/2] ext4: implement cgroup writeback support 2015-06-16 22:53 [PATCHSET v2 block/for-4.2/writeback] " Tejun Heo @ 2015-06-16 22:53 ` Tejun Heo [not found] ` <1434495193-31182-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 18+ messages in thread From: Tejun Heo @ 2015-06-16 22:53 UTC (permalink / raw) To: axboe Cc: linux-kernel, linux-fsdevel, lizefan, cgroups, hannes, kernel-team, tytso, adilger.kernel, linux-ext4, Tejun Heo For ordered and writeback data modes, all data IOs go through ext4_io_submit. This patch adds cgroup writeback support by invoking wbc_init_bio() from io_submit_init_bio() and wbc_account_io() in io_submit_add_bh(). Journal data which is written by jbd2 worker is left alone by this patch and will always be written out from the root cgroup. ext4_fill_super() is updated to set MS_CGROUPWB when data mode is either ordered or writeback. In journaled data mode, most IOs become synchronous through the journal and enabling cgroup writeback support doesn't make much sense or difference. Journaled data mode is left alone. Lightly tested with sequential data write workload. Behaves as expected. v2: Updated for MS_CGROUPWB -> SB_I_CGROUPWB. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: linux-ext4@vger.kernel.org --- fs/ext4/page-io.c | 2 ++ fs/ext4/super.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 3f80cb2..c56ba7b 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -383,6 +383,7 @@ static int io_submit_init_bio(struct ext4_io_submit *io, bio = bio_alloc(GFP_NOIO, min(nvecs, BIO_MAX_PAGES)); if (!bio) return -ENOMEM; + wbc_init_bio(io->io_wbc, bio); bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); bio->bi_bdev = bh->b_bdev; bio->bi_end_io = ext4_end_bio; @@ -411,6 +412,7 @@ static int io_submit_add_bh(struct ext4_io_submit *io, ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh)); if (ret != bh->b_size) goto submit_and_retry; + wbc_account_io(io->io_wbc, page, bh->b_size); io->io_next_block++; return 0; } diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 56b8bb7..3ad1eb4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3623,6 +3623,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } if (test_opt(sb, DELALLOC)) clear_opt(sb, DELALLOC); + } else { + sb->s_iflags |= SB_I_CGROUPWB; } sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | -- 2.4.3 ^ permalink raw reply related [flat|nested] 18+ messages in thread
[parent not found: <1434495193-31182-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH 2/2] ext4: implement cgroup writeback support [not found] ` <1434495193-31182-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> @ 2015-07-22 3:56 ` Theodore Ts'o 2015-09-23 12:49 ` Artem Bityutskiy 0 siblings, 1 reply; 18+ messages in thread From: Theodore Ts'o @ 2015-07-22 3:56 UTC (permalink / raw) To: Tejun Heo Cc: axboe-tSWWG44O7X1aa/9Udqfwiw, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w, kernel-team-b10kYP2dOMg, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, linux-ext4-u79uwXL29TY76Z2rM5mHXA On Tue, Jun 16, 2015 at 06:53:13PM -0400, Tejun Heo wrote: > For ordered and writeback data modes, all data IOs go through > ext4_io_submit. This patch adds cgroup writeback support by invoking > wbc_init_bio() from io_submit_init_bio() and wbc_account_io() in > io_submit_add_bh(). Journal data which is written by jbd2 worker is > left alone by this patch and will always be written out from the root > cgroup. > > ext4_fill_super() is updated to set MS_CGROUPWB when data mode is > either ordered or writeback. In journaled data mode, most IOs become > synchronous through the journal and enabling cgroup writeback support > doesn't make much sense or difference. Journaled data mode is left > alone. > > Lightly tested with sequential data write workload. Behaves as > expected. > > v2: Updated for MS_CGROUPWB -> SB_I_CGROUPWB. > > Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > Cc: "Theodore Ts'o" <tytso-3s7WtUTddSA@public.gmane.org> > Cc: Andreas Dilger <adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org> > Cc: linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Thanks, applied. - Ted ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-07-22 3:56 ` Theodore Ts'o @ 2015-09-23 12:49 ` Artem Bityutskiy 2015-09-23 13:50 ` Artem Bityutskiy ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Artem Bityutskiy @ 2015-09-23 12:49 UTC (permalink / raw) To: Theodore Ts'o, Tejun Heo Cc: axboe, linux-kernel, linux-fsdevel, lizefan, cgroups, hannes, kernel-team, adilger.kernel, linux-ext4 On Tue, 2015-07-21 at 23:56 -0400, Theodore Ts'o wrote: > > v2: Updated for MS_CGROUPWB -> SB_I_CGROUPWB. > > > > Signed-off-by: Tejun Heo <tj@kernel.org> > > Cc: "Theodore Ts'o" <tytso@mit.edu> > > Cc: Andreas Dilger <adilger.kernel@dilger.ca> > > Cc: linux-ext4@vger.kernel.org > > Thanks, applied. Hi, this patch introduces a regression - a major one, I'd say. Symptoms: copy a bunch of file, run sync, then run 'reboot', and after you boot up the copied files are corrupted. So basically the user -visible symptom is that 'sync' does not work. I quite an effort to bisect it, but it led me to this patch. If I take the latest upstream (v4.3-rc2+), and revert this patch: 001e4a8 ext4: imlpement cgroup writeback support then the problem goes away - files are not corrupted after reboot. I use ext4 on top of a "bare" partition, no LVM or dm layers involved. I use Fedora 22 with all the latest package updates, and I only change the kernel there. The corruption seems to be that the start with a bunch of zeroes instead of the real data, but I did not check carefully, looked only at one file briefly. Artem. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 12:49 ` Artem Bityutskiy @ 2015-09-23 13:50 ` Artem Bityutskiy 2015-09-23 17:02 ` Theodore Ts'o 2015-09-23 17:25 ` Chris Mason [not found] ` <1443012552.19983.209.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2 siblings, 1 reply; 18+ messages in thread From: Artem Bityutskiy @ 2015-09-23 13:50 UTC (permalink / raw) To: Theodore Ts'o, Tejun Heo Cc: axboe, linux-kernel, linux-fsdevel, lizefan, cgroups, hannes, kernel-team, adilger.kernel, linux-ext4 On Wed, 2015-09-23 at 15:49 +0300, Artem Bityutskiy wrote: > On Tue, 2015-07-21 at 23:56 -0400, Theodore Ts'o wrote: > > > v2: Updated for MS_CGROUPWB -> SB_I_CGROUPWB. > > > > > > Signed-off-by: Tejun Heo <tj@kernel.org> > > > Cc: "Theodore Ts'o" <tytso@mit.edu> > > > Cc: Andreas Dilger <adilger.kernel@dilger.ca> > > > Cc: linux-ext4@vger.kernel.org > > > > Thanks, applied. > > Hi, this patch introduces a regression - a major one, I'd say. > > Symptoms: copy a bunch of file, run sync, then run 'reboot', and > after > you boot up the copied files are corrupted. So basically the user > -visible symptom is that 'sync' does not work. Just FYI, this is the issue I briefly reported last Fri: https://lkml.org/lkml/2015/9/18/640 Artem. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 13:50 ` Artem Bityutskiy @ 2015-09-23 17:02 ` Theodore Ts'o 2015-09-23 17:57 ` Tejun Heo 0 siblings, 1 reply; 18+ messages in thread From: Theodore Ts'o @ 2015-09-23 17:02 UTC (permalink / raw) To: Artem Bityutskiy Cc: Tejun Heo, axboe, linux-kernel, linux-fsdevel, lizefan, cgroups, hannes, kernel-team, adilger.kernel, linux-ext4 On Wed, Sep 23, 2015 at 04:50:53PM +0300, Artem Bityutskiy wrote: > On Wed, 2015-09-23 at 15:49 +0300, Artem Bityutskiy wrote: > > On Tue, 2015-07-21 at 23:56 -0400, Theodore Ts'o wrote: > > > > v2: Updated for MS_CGROUPWB -> SB_I_CGROUPWB. > > > > > > > > Signed-off-by: Tejun Heo <tj@kernel.org> > > > > Cc: "Theodore Ts'o" <tytso@mit.edu> > > > > Cc: Andreas Dilger <adilger.kernel@dilger.ca> > > > > Cc: linux-ext4@vger.kernel.org > > > > > > Thanks, applied. > > > > Hi, this patch introduces a regression - a major one, I'd say. > > > > Symptoms: copy a bunch of file, run sync, then run 'reboot', and > > after > > you boot up the copied files are corrupted. So basically the user > > -visible symptom is that 'sync' does not work. > > Just FYI, this is the issue I briefly reported last Fri: > > https://lkml.org/lkml/2015/9/18/640 Also note this performance regression reported by Dexuan Cui https://lkml.org/lkml/2015/9/23/333 I didn't notice these problems since I my userspace doesn't enable the writeback cgroup. (In fact I don't know how to do it using Debian Jessie.) Tejun, can you please take a look at this and give me a recommendation? I'm willing to wait a day or two while we try to fix the problem, but past that point I'd like to have a fix or revert this commit before Linus releases the next -rc release. - Ted ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 17:02 ` Theodore Ts'o @ 2015-09-23 17:57 ` Tejun Heo 0 siblings, 0 replies; 18+ messages in thread From: Tejun Heo @ 2015-09-23 17:57 UTC (permalink / raw) To: Theodore Ts'o Cc: Artem Bityutskiy, axboe, linux-kernel, linux-fsdevel, lizefan, cgroups, hannes, kernel-team, adilger.kernel, linux-ext4 Hello, Ted. On Wed, Sep 23, 2015 at 01:02:38PM -0400, Theodore Ts'o wrote: > Also note this performance regression reported by Dexuan Cui > > https://lkml.org/lkml/2015/9/23/333 > > I didn't notice these problems since I my userspace doesn't enable the > writeback cgroup. (In fact I don't know how to do it using Debian > Jessie.) The thing is I don't think they're either. > Tejun, can you please take a look at this and give me a > recommendation? I'm willing to wait a day or two while we try to fix > the problem, but past that point I'd like to have a fix or revert this > commit before Linus releases the next -rc release. Yeap, looking at them both. Will update as soon as I know more. Thanks. -- tejun ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 12:49 ` Artem Bityutskiy 2015-09-23 13:50 ` Artem Bityutskiy @ 2015-09-23 17:25 ` Chris Mason [not found] ` <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g@mail.gmail.com> [not found] ` <1443012552.19983.209.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2 siblings, 1 reply; 18+ messages in thread From: Chris Mason @ 2015-09-23 17:25 UTC (permalink / raw) To: Artem Bityutskiy Cc: Theodore Ts'o, Tejun Heo, axboe, linux-kernel, linux-fsdevel, lizefan, cgroups, hannes, kernel-team, adilger.kernel, linux-ext4 On Wed, Sep 23, 2015 at 03:49:12PM +0300, Artem Bityutskiy wrote: > On Tue, 2015-07-21 at 23:56 -0400, Theodore Ts'o wrote: > > > v2: Updated for MS_CGROUPWB -> SB_I_CGROUPWB. > > > > > > Signed-off-by: Tejun Heo <tj@kernel.org> > > > Cc: "Theodore Ts'o" <tytso@mit.edu> > > > Cc: Andreas Dilger <adilger.kernel@dilger.ca> > > > Cc: linux-ext4@vger.kernel.org > > > > Thanks, applied. > > Hi, this patch introduces a regression - a major one, I'd say. > > Symptoms: copy a bunch of file, run sync, then run 'reboot', and after > you boot up the copied files are corrupted. So basically the user > -visible symptom is that 'sync' does not work. Hi Artem, Are you doing a hard shutdown (reboot -nf)? If you're doing a friendly shutdown, is the FS unmounting cleanly? > > I quite an effort to bisect it, but it led me to this patch. I bet it was a long bisect. Trying to see if the same patch to btrfs has similar impacts. -chris ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g@mail.gmail.com>]
* Re: [PATCH 2/2] ext4: implement cgroup writeback support [not found] ` <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g@mail.gmail.com> @ 2015-09-23 17:53 ` Chris Mason 2015-09-23 18:24 ` Theodore Ts'o [not found] ` <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 1 sibling, 1 reply; 18+ messages in thread From: Chris Mason @ 2015-09-23 17:53 UTC (permalink / raw) To: Artem Bityutskiy Cc: linux-ext4, hannes, axboe, Tejun Heo, Theodore Ts'o, linux-fsdevel, lizefan, cgroups, adilger.kernel, kernel-team, linux-kernel On Wed, Sep 23, 2015 at 08:41:25PM +0300, Artem Bityutskiy wrote: > Hi > > $ sync > $ reboot If this is case, it should be possible to reproduce with: cp a bunch of stuff to /ext4 unmount /ext4 mount ext4 compare data If you're not getting a clean unmount of the test FS during the reboot, its a different test. Trying to reproduce here, so far its clean. Could you please double check for failed unmounts? Thanks, Chris ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 17:53 ` Chris Mason @ 2015-09-23 18:24 ` Theodore Ts'o [not found] ` <CAF4G-t+E89a_A3RzQYB9wXxqE6nM0t7wN6fNmLABZ70=ivHTRQ@mail.gmail.com> 0 siblings, 1 reply; 18+ messages in thread From: Theodore Ts'o @ 2015-09-23 18:24 UTC (permalink / raw) To: Chris Mason, Artem Bityutskiy, linux-ext4, hannes, axboe, Tejun Heo, linux-fsdevel, lizefan, cgroups, adilger.kernel, kernel-team, linux-kernel Artem, Can you (or someone on the cgroups list, perhaps) give more details about how Fedora 22 sets up groups? Unfortunately apparently no one has gotten an official Fedora image for Google Compute Engine so it's a bit of a pain for me to reproduce the problem. (I suppose I could use AWS, but all of my test infrastructure uses GCE, and I'd really rather not have to install a Java Runtime on my laptop. :-) Or can you reproduce this problem on Debian Jessie? Thanks, - Ted ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <CAF4G-t+E89a_A3RzQYB9wXxqE6nM0t7wN6fNmLABZ70=ivHTRQ@mail.gmail.com>]
[parent not found: <CAF4G-t+E89a_A3RzQYB9wXxqE6nM0t7wN6fNmLABZ70=ivHTRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/2] ext4: implement cgroup writeback support [not found] ` <CAF4G-t+E89a_A3RzQYB9wXxqE6nM0t7wN6fNmLABZ70=ivHTRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2015-09-23 19:47 ` Artem Bityutskiy 2015-09-23 20:48 ` Theodore Ts'o 0 siblings, 1 reply; 18+ messages in thread From: Artem Bityutskiy @ 2015-09-23 19:47 UTC (permalink / raw) To: Theodore Ts'o, Chris Mason, Artem Bityutskiy, linux-ext4-u79uwXL29TY76Z2rM5mHXA, Johannes Weiner, axboe-tSWWG44O7X1aa/9Udqfwiw, Tejun Heo, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, kernel-team-b10kYP2dOMg, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Wed, Sep 23, 2015 at 9:24 PM, Theodore Ts'o <tytso-3s7WtUTddSA@public.gmane.org> wrote: > Artem, > > Can you (or someone on the cgroups list, perhaps) give more details > about how Fedora 22 sets up groups? > > Unfortunately apparently no one has gotten an official Fedora image > for Google Compute Engine so it's a bit of a pain for me to reproduce > the problem. (I suppose I could use AWS, but all of my test > infrastructure uses GCE, and I'd really rather not have to install a > Java Runtime on my laptop. :-) [ My apologies for top posting and for sending HTML e-mails which do not get through vger. I am using gmail web interface, and just learned how to send plain text from here. So re-sending my longer answer. ] Hi Ted, Chris, Tejun, all, quick and probably messy reply before I go to sleep... I can give more information tomorrow. But one note - It would be helpful to get questions like "send us the output of this command" rather than "what are the cgroups you are in", because I am not fluent with cgroups. IOW, more specific questions are welcome. Some more about my setup. I have an number of testboxes, which are 1/2/4-socket servers. I compile the kernel for them on a separate worker box. Then I copy the kernel binary to /boot, and the modules to /lib/modules, then run 'sync' and then reboot to reboot to the new kernel. And vrey often many module files are corrupted. They won't load because of majic/crc mismatches. I copy stuff over scp. Well, this is not exactly scp, but rather a Python 'scp' module, which is based on the 'paramiko' module. But I think this should not matter. Anyway, may be there are some cgroups related with scp/ssh sessions or /lib/modules in Fedora 22? Also note, I tried to be careful during bisecting, I used 4 servers in parallel, and did 5 reboot tests on each of them. With this patch reverted all 4 boxes survive 5 reboots just fine. Without this patch reverted, each fail 1-3 reboots. And, by the way, I forgot this detail - I cut AC power off at the end, then put it back on after a 20 seconds delay. I mean, this is a clean reboot, but with power cut at the end. So the process is this: 1. I run 'sync' on the box remotely over ssh 2. I run 'reboot' on the box remotely over ssh, the ssh connection gets closed at this point 3. I ping the box, and keep doing this until it is stops echoing back 4. I wait several seconds, and then just cut the AC power off. The wall socket power is off. So if there was something in, say, SSD cache which was not synced, it is gone too. May be this patch reveals an existing issue. My setup has been stable with 4.2 and many previous kernels, and it only fails with 4.3-rcX, and my bisecting lead to this patch. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 19:47 ` Artem Bityutskiy @ 2015-09-23 20:48 ` Theodore Ts'o 2015-09-24 8:13 ` Artem Bityutskiy 0 siblings, 1 reply; 18+ messages in thread From: Theodore Ts'o @ 2015-09-23 20:48 UTC (permalink / raw) To: Artem Bityutskiy Cc: Chris Mason, linux-ext4, Johannes Weiner, axboe, Tejun Heo, linux-fsdevel, lizefan, cgroups, adilger.kernel, kernel-team, linux-kernel@vger.kernel.org On Wed, Sep 23, 2015 at 10:47:16PM +0300, Artem Bityutskiy wrote: > And, by the way, I forgot this detail - I cut AC power off at the > end, then put it back on after a 20 seconds delay. I mean, this is a > clean reboot, but with power cut at the end. Is this reproducible without the power cut? And what model SSD are you using, and are you sure that it has Power Loss Protection (many SSD vendors use power loss protection as the price discrimination feature between consumer-grade SSD and enterprise-grade SSD's that cost $$$). If this problem wasn't showing up with 4.2, and is only failing with 4.3-rcX, then it might not be a hardware issue --- but it's also possible that there was a timing issue which was hiding a hardware problem. So for the purposes of debugging, removing the power cut from the set of variables is a useful thing to do. - Ted ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] ext4: implement cgroup writeback support 2015-09-23 20:48 ` Theodore Ts'o @ 2015-09-24 8:13 ` Artem Bityutskiy 0 siblings, 0 replies; 18+ messages in thread From: Artem Bityutskiy @ 2015-09-24 8:13 UTC (permalink / raw) To: Theodore Ts'o Cc: Chris Mason, linux-ext4, Johannes Weiner, axboe, Tejun Heo, linux-fsdevel, lizefan, cgroups, adilger.kernel, kernel-team, linux-kernel@vger.kernel.org On Wed, 2015-09-23 at 16:48 -0400, Theodore Ts'o wrote: > On Wed, Sep 23, 2015 at 10:47:16PM +0300, Artem Bityutskiy wrote: > > And, by the way, I forgot this detail - I cut AC power off at the > > end, then put it back on after a 20 seconds delay. I mean, this is > > a > > clean reboot, but with power cut at the end. > > Is this reproducible without the power cut? And what model SSD are > you using, and are you sure that it has Power Loss Protection (many > SSD vendors use power loss protection as the price discrimination > feature between consumer-grade SSD and enterprise-grade SSD's that > cost $$$). If this problem wasn't showing up with 4.2, and is only > failing with 4.3-rcX, then it might not be a hardware issue --- but > it's also possible that there was a timing issue which was hiding a > hardware problem. So for the purposes of debugging, removing the > power cut from the set of variables is a useful thing to do. Ted, you are right that the problem may be anywhere, but since Tejun's patch fixes it, I decided to not spend time on testing without AC power cuts. But I checked and on of my boxes uses an HDD, and it shows the same problem, which makes the theory of imperfect SSD firmware being involved less likely. Thanks, Artem. ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/2] ext4: implement cgroup writeback support [not found] ` <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2015-09-23 19:03 ` Tejun Heo 0 siblings, 0 replies; 18+ messages in thread From: Tejun Heo @ 2015-09-23 19:03 UTC (permalink / raw) To: Artem Bityutskiy Cc: linux-ext4-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w, axboe-tSWWG44O7X1aa/9Udqfwiw, Theodore Ts'o, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, Chris Mason, kernel-team-b10kYP2dOMg, linux-kernel-u79uwXL29TY76Z2rM5mHXA Hello, Artem. On Wed, Sep 23, 2015 at 08:41:25PM +0300, Artem Bityutskiy wrote: > $ sync > $ reboot > > is exactly the sequence. Can you please test with 4.3-rc2 and see whether the issue is reproducible? The multi-wb wait logic rewrite was merged during rc1 and I'm wondering whether this is a bug in the old implementation. Thanks. -- tejun ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <1443012552.19983.209.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 2/2] ext4: implement cgroup writeback support [not found] ` <1443012552.19983.209.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2015-09-23 18:09 ` Tejun Heo [not found] ` <20150923180934.GE26647-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org> 0 siblings, 1 reply; 18+ messages in thread From: Tejun Heo @ 2015-09-23 18:09 UTC (permalink / raw) To: Artem Bityutskiy Cc: Theodore Ts'o, axboe-tSWWG44O7X1aa/9Udqfwiw, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w, kernel-team-b10kYP2dOMg, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, linux-ext4-u79uwXL29TY76Z2rM5mHXA Hello, Artem. On Wed, Sep 23, 2015 at 03:49:12PM +0300, Artem Bityutskiy wrote: > I use Fedora 22 with all the latest package updates, and I only change > the kernel there. What's your cgroup setup like? Are you trying out the unified hierarchy? Given that you didn't mention that, I'm guessing you aren't which makes me pretty head-scratchy because I don't see how the actual behavior would change depending on that flag. I'll dig more. Thanks. -- tejun ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <20150923180934.GE26647-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>]
* Re: [PATCH 2/2] ext4: implement cgroup writeback support [not found] ` <20150923180934.GE26647-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org> @ 2015-09-23 18:51 ` Tejun Heo 0 siblings, 0 replies; 18+ messages in thread From: Tejun Heo @ 2015-09-23 18:51 UTC (permalink / raw) To: Artem Bityutskiy Cc: Theodore Ts'o, axboe-tSWWG44O7X1aa/9Udqfwiw, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w, kernel-team-b10kYP2dOMg, adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q, linux-ext4-u79uwXL29TY76Z2rM5mHXA On Wed, Sep 23, 2015 at 02:09:34PM -0400, Tejun Heo wrote: > Hello, Artem. > > On Wed, Sep 23, 2015 at 03:49:12PM +0300, Artem Bityutskiy wrote: > > I use Fedora 22 with all the latest package updates, and I only change > > the kernel there. > > What's your cgroup setup like? Are you trying out the unified > hierarchy? Given that you didn't mention that, I'm guessing you > aren't which makes me pretty head-scratchy because I don't see how the > actual behavior would change depending on that flag. I'll dig more. Ugh... never mind. I spotted what I did wrong. The sync thing still needs figuring out (it still should have worked) but fixing the regression should be easy. Will update soon. Thanks. -- tejun ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2015-09-24 8:13 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-06-12 22:02 [PATCHSET block/for-4.2/writeback] ext4: implement cgroup writeback support Tejun Heo 2015-06-12 22:02 ` [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc Tejun Heo 2015-06-12 22:02 ` [PATCH 2/2] ext4: implement cgroup writeback support Tejun Heo -- strict thread matches above, loose matches on Subject: below -- 2015-06-16 22:53 [PATCHSET v2 block/for-4.2/writeback] " Tejun Heo 2015-06-16 22:53 ` [PATCH 2/2] " Tejun Heo [not found] ` <1434495193-31182-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 2015-07-22 3:56 ` Theodore Ts'o 2015-09-23 12:49 ` Artem Bityutskiy 2015-09-23 13:50 ` Artem Bityutskiy 2015-09-23 17:02 ` Theodore Ts'o 2015-09-23 17:57 ` Tejun Heo 2015-09-23 17:25 ` Chris Mason [not found] ` <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g@mail.gmail.com> 2015-09-23 17:53 ` Chris Mason 2015-09-23 18:24 ` Theodore Ts'o [not found] ` <CAF4G-t+E89a_A3RzQYB9wXxqE6nM0t7wN6fNmLABZ70=ivHTRQ@mail.gmail.com> [not found] ` <CAF4G-t+E89a_A3RzQYB9wXxqE6nM0t7wN6fNmLABZ70=ivHTRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2015-09-23 19:47 ` Artem Bityutskiy 2015-09-23 20:48 ` Theodore Ts'o 2015-09-24 8:13 ` Artem Bityutskiy [not found] ` <CAF4G-tKEcnVw76-ZU77AjmBDGybLnNEOKjkJtYBN67es0wb30g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2015-09-23 19:03 ` Tejun Heo [not found] ` <1443012552.19983.209.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2015-09-23 18:09 ` Tejun Heo [not found] ` <20150923180934.GE26647-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org> 2015-09-23 18:51 ` Tejun Heo
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).