From patchwork Sun Sep 30 02:11:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itaru Kitayama X-Patchwork-Id: 1528661 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C0EB1DF280 for ; Sun, 30 Sep 2012 02:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946Ab2I3CLN (ORCPT ); Sat, 29 Sep 2012 22:11:13 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:44092 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388Ab2I3CLL (ORCPT ); Sat, 29 Sep 2012 22:11:11 -0400 Received: by lbon3 with SMTP id n3so3107575lbo.19 for ; Sat, 29 Sep 2012 19:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JMbQ4/joLPqMTemGCGInj0NN0rFw1HakEErBpP4FVP8=; b=r2vNiuksFNC9Aa/pe71tbFC0rD74XYiZNGQS7mApyutewWWM4YNXUZCCy2BXj9JPD7 RWMncmEq2NRJrEE9Z+9mf3r51l/Tsh+j6s69zM2+m9bxu+ZHxRV6J5iPSIAQ2gCfrbGU fllS3QPQmgzg0AcnwjPuFc5I7ouQhTCWTsCmNcL71XBSmHujeSgcMHq547GpyNSqyNQg DKms9vKlayStqTytqQ/rgpwQwn0Vm3QX0gKgOVVhiO3VqZuFtfQK9wO8DxFDkP/j3ZFY VfOpaTzV9ppaZjQIhN+4q9URhmd2JIzcn8aI3AzCyVjpkCrYIMvN4zlUb3TehaiDYP6a JM5w== MIME-Version: 1.0 Received: by 10.112.51.228 with SMTP id n4mr4031518lbo.55.1348971070300; Sat, 29 Sep 2012 19:11:10 -0700 (PDT) Received: by 10.114.60.74 with HTTP; Sat, 29 Sep 2012 19:11:10 -0700 (PDT) In-Reply-To: References: <20120929162140.GI14582@twin.jikos.cz> Date: Sun, 30 Sep 2012 11:11:10 +0900 Message-ID: Subject: Re: [PATCH] Btrfs: shrink_delalloc check bdi write congested From: Itaru Kitayama To: linux-btrfs@vger.kernel.org Cc: dave@jikos.cz Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This is the correct one. Signed-off-by: Itaru Kitayama * We need to wait for the async pages to actually start before On Sun, Sep 30, 2012 at 10:28 AM, Itaru Kitayama wrote: > Resubmit this after the checkpatch test. > > In srhink_delalloc(), writeback starts if idle, also check the bdi is > not write congested. > The patch is against the head of the btrfs-next. > > Signed-off-by: Itaru Kitayama > > diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c > index efb044e..1aae046 100644 > --- a/fs/btrfs/extent-tree.c > +++ b/fs/btrfs/extent-tree.c > @@ -3712,8 +3712,9 @@ static void shrink_delalloc(struct btrfs_root > *root, u64 to_reclaim, u64 orig, > while (delalloc_bytes && loops < 3) { > max_reclaim = min(delalloc_bytes, to_reclaim); > nr_pages = max_reclaim >> PAGE_CACHE_SHIFT; > - writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages, > - WB_REASON_FS_FREE_SPACE); > + if (!bdi_write_congested(root->fs_info->sb->s_bdi)) > + writeback_inodes_sb_nr_if_idle(root->fs_info, nr_page, > + WB_REASON_FS_FREE_SPACE); > > /* > * We need to wait for the async pages to actually start before > > > On Sun, Sep 30, 2012 at 1:21 AM, David Sterba wrote: >> On Sat, Sep 29, 2012 at 10:20:09PM +0900, Itaru Kitayama wrote: >>> --- a/fs/btrfs/extent-tree.c >>> +++ b/fs/btrfs/extent-tree.c >>> @@ -3712,7 +3712,7 @@ static void shrink_delalloc(struct btrfs_root *root, u64 t >>> while (delalloc_bytes && loops < 3) { >>> max_reclaim = min(delalloc_bytes, to_reclaim); >>> nr_pages = max_reclaim >> PAGE_CACHE_SHIFT; >>> - writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages, >>> + if (!bdi_write_congested(root->fs_info->sb->s_bdi)) writeback_in >>> WB_REASON_FS_FREE_SPACE); >> >> malformed patch --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index efb044e..c032dbe 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3712,8 +3712,9 @@ static void shrink_delalloc(struct btrfs_root *root, u64 to_reclaim, u64 orig, while (delalloc_bytes && loops < 3) { max_reclaim = min(delalloc_bytes, to_reclaim); nr_pages = max_reclaim >> PAGE_CACHE_SHIFT; - writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages, - WB_REASON_FS_FREE_SPACE); + if (!bdi_write_congested(root->fs_info->sb->s_bdi)) + writeback_inodes_sb_nr_if_idle(root->fs_info, nr_pages, + WB_REASON_FS_FREE_SPACE); /*