From patchwork Wed Mar 30 15:07:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 8698171 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB9E89F3D1 for ; Wed, 30 Mar 2016 15:11:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDAEC20386 for ; Wed, 30 Mar 2016 15:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 045952026F for ; Wed, 30 Mar 2016 15:11:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080AbcC3PLA (ORCPT ); Wed, 30 Mar 2016 11:11:00 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:44406 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753925AbcC3PIM (ORCPT ); Wed, 30 Mar 2016 11:08:12 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.11/8.16.0.11) with SMTP id u2UF6GrC006106; Wed, 30 Mar 2016 08:08:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=C9XGGy1Q93FEp3owVb/8y0XQE4HoIrOZ5XZcOxa2Xhw=; b=R7UVr06E2+z87JwWQROpLZoKV9SGEPD0SiAlAr2uHdDeFsetoG2GkZZrmH9aOUsfLtvN 6mG0rwAbU1R1L779mE8nNoDTIcZ0auoI3s2U461qE5HJEJHgGAJA9D1fNsyKuA72SxUt 9Sb0dka+MS1bQdBqtBkzJkLFJ6bADTzkDEc= Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 22037dp8hy-3 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT); Wed, 30 Mar 2016 08:08:11 -0700 Received: from localhost.localdomain (192.168.54.13) by mail.thefacebook.com (192.168.16.22) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 30 Mar 2016 08:08:07 -0700 From: Jens Axboe To: , , CC: Jens Axboe Subject: [PATCH 4/9] writeback: track if we're sleeping on progress in balance_dirty_pages() Date: Wed, 30 Mar 2016 09:07:52 -0600 Message-ID: <1459350477-16404-5-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.8.0.rc4.6.g7e4ba36 In-Reply-To: <1459350477-16404-1-git-send-email-axboe@fb.com> References: <1459350477-16404-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-30_08:, , signatures=0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Note in the bdi_writeback structure if a task is currently being limited in balance_dirty_pages(), waiting for writeback to proceed. Signed-off-by: Jens Axboe --- include/linux/backing-dev-defs.h | 2 ++ mm/page-writeback.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index 1b4d69f68c33..f702309216b4 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -116,6 +116,8 @@ struct bdi_writeback { struct list_head work_list; struct delayed_work dwork; /* work item used for writeback */ + int dirty_sleeping; /* waiting on dirty limit exceeded */ + struct list_head bdi_node; /* anchored at bdi->wb_list */ #ifdef CONFIG_CGROUP_WRITEBACK diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 11ff8f758631..15e696bc5d14 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1746,7 +1746,9 @@ pause: pause, start_time); __set_current_state(TASK_KILLABLE); + wb->dirty_sleeping = 1; io_schedule_timeout(pause); + wb->dirty_sleeping = 0; current->dirty_paused_when = now + pause; current->nr_dirtied = 0;