From patchwork Sun Sep 30 01:28:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itaru Kitayama X-Patchwork-Id: 1528651 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E79B13FE4F for ; Sun, 30 Sep 2012 01:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080Ab2I3B2u (ORCPT ); Sat, 29 Sep 2012 21:28:50 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:34086 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072Ab2I3B2q (ORCPT ); Sat, 29 Sep 2012 21:28:46 -0400 Received: by lbon3 with SMTP id n3so3096086lbo.19 for ; Sat, 29 Sep 2012 18:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=wc8a+ybmRyvIpumXiAKbjhpiDqGxpqASQEa70bWAvds=; b=OWfydKNTO9m5Y0albOTarAhQPfUeJNW9MChf+Opp2YohCpYEKt65NLkbqB7cInKt7S XyKaf+EuzzmDpTBIaYmkivG8HID1BKeIz39BHZ8RFqx74YZ8FaTQ4TUYblikVxouKgZf bPT1sZ/rBzTCwXYw/UM2OrcVebUsnA2Mj2i3GPQLjUAyK05YjIuOerXakit0f1OtN1wl CrR+/S62P0pgfALEJWZ9Vxdtx0swyvllHD+ZYdPIbTe/oxuTjCOZdFzaDMvYaBEPbsyY zLIfMrWCqgQ5zGsqgxLQC/orHUSMyu4Ejk1NIdTG9zQtafyhsPzLOFHeNW3Vyw4IY8eZ sAGQ== MIME-Version: 1.0 Received: by 10.112.38.163 with SMTP id h3mr4001384lbk.130.1348968524825; Sat, 29 Sep 2012 18:28:44 -0700 (PDT) Received: by 10.114.60.74 with HTTP; Sat, 29 Sep 2012 18:28:44 -0700 (PDT) In-Reply-To: <20120929162140.GI14582@twin.jikos.cz> References: <20120929162140.GI14582@twin.jikos.cz> Date: Sun, 30 Sep 2012 10:28:44 +0900 X-Google-Sender-Auth: Y_crlLiN4SPpYqBXYkCJ7gAsQq4 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 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 * 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..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); /*