Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033997AbcJTPjQ (ORCPT ); Thu, 20 Oct 2016 11:39:16 -0400 Received: from mail-db5eur01on0083.outbound.protection.outlook.com ([104.47.2.83]:52800 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030433AbcJTPjN (ORCPT ); Thu, 20 Oct 2016 11:39:13 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=mika.penttila@nextfour.com; Subject: Re: [PATCH] bdi flusher should not be throttled here when it fall into buddy slow path To: , References: <1476774765-21130-1-git-send-email-zhouxianrong@huawei.com> <1476967085-89647-1-git-send-email-zhouxianrong@huawei.com> CC: , , , , , , , , , , , , , , , From: =?UTF-8?Q?Mika_Penttil=c3=a4?= Message-ID: Date: Thu, 20 Oct 2016 16:05:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1476967085-89647-1-git-send-email-zhouxianrong@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [84.250.21.106] X-ClientProxiedBy: VI1PR07CA0099.eurprd07.prod.outlook.com (10.165.229.153) To DB6PR0701MB2165.eurprd07.prod.outlook.com (10.168.58.20) X-MS-Office365-Filtering-Correlation-Id: 73718cb7-ed4d-4051-d2cd-08d3f8e9bd9c X-Microsoft-Exchange-Diagnostics: 1;DB6PR0701MB2165;2:iA5bjpM2y2R+4DB6r6Cv6nuXFCzPvbidYNqrKfGYMAviGWIbdn9Zej/g84ssWPpvzQsjiVCdTASHa8SCM1Jg+N/iUsFcMtxYuNs9h3g36+dvmcZJ2izIFEc7Z8NoSO87L3YA8d9V2JxmkTiP9RtAmaVmpV87sIv3SLo+Wwvh6Sj2q50T6MIK/xc1vb2Mgi9S8edQuYhqZ1Le7yHabglnWQ==;3:o9PpZxij75A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GPbj/nHMCB2OLONqynYOkxpoD6pXp+Mk20iixZthhnWFYmAnZuV4qJoMOVN/RZnYbESFcRTCH53/Ild3Pb1Pf0cA5JGucsdPS6eKFGCFg7Qmdmh1/AFYzn7JsSqM4DbAzakMDWKUNSJGOyrC4cDYBnYwFX/XO7ALBv2pkBCVQJIWH7fA0oA70Ij88ipSJLgFgnKx33DyCsl3J;4:pkpekSbEwnI0HXPBaowzuIcuz2sCwwnwPNywLMK77r+BlEZvwHdqzYtdDr7aSbr3WfmNjuFfZGhL+3ZELakYtKD3dwg6bjwNu17XwegC4d4/b2Zk67lGQE4brMgOI5r9IxWTD6oSj0hLCODWSU/6aHgEy/8J0hv2tsR2mOcVqe3Rrh74EJJc5rWqbgTKeTLB5OMnT3wdJU2MMB2dHP+rKLfDePK9FaL1WPT+Hrs/p5LNC0tiM2Zof1ZmXzfOcaVzvWlmcy0F4fp+HDxTcVgPczqdtqVsX5OCL8FQmN+xIPQzm6k1Oqw13zCRNmXQZAgP3eitoHb51/et4CXCQzFA3E7Ek1g6ztbcaEcd29KsmSjF8cQR/sdzvQaEMJnT0GVWN4Jhsf7VdiFGxnGV0Rtk/kTJ7Z5o/4NwOUsmUM54UH7rxA6va+7/vSpsLgJN6kMYPvqCluVwvd8XfE1BCPFuEg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(50582790962513); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:DB6PR0701MB2165;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0701MB2165; X-Forefront-PRVS: 01018CB5B3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(189002)(24454002)(199003)(2950100002)(65956001)(68736007)(6666003)(230700001)(83506001)(19580395003)(3846002)(117156001)(305945005)(8676002)(65806001)(6116002)(7736002)(19580405001)(42186005)(36756003)(50986999)(81166006)(5660300001)(92566002)(2906002)(65826007)(54356999)(31686004)(97736004)(50466002)(7846002)(7416002)(76176999)(105586002)(86362001)(31696002)(33646002)(66066001)(5001770100001)(47776003)(4001350100001)(64126003)(77096005)(189998001)(101416001)(586003)(106356001)(4326007)(81156014)(23746002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0701MB2165;H:[192.168.1.71];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DB6PR0701MB2165;23:3i5w0kBIB9CxM8BlPfJ7abLk3IshhEpKqVH?= =?Windows-1252?Q?NXwVSyr7z5W/dSIBwJF6SOgtJLS6rNzHLAavlec/iWnlbbmjYNjRg9w2?= =?Windows-1252?Q?ahnzHwlEz81BGBC+pO+mXRkqIpJBtj1Lf4wYn+o6YpClTglP/tcc3JU3?= =?Windows-1252?Q?EApCFeyJ3jIsgz8NbO4omRvDXsP3hO1FcARyYEF51Kw5jeJudwC6sQS4?= =?Windows-1252?Q?lFkgmVOx2ZXFNdEToi9KEoFYdGPuwIDBXduwHSQd51QI4+SCP5wuYEFA?= =?Windows-1252?Q?nROLyqkVBaX89VTsiTxLM1kjWD+7PfobCWtQfNpVix5kNcSMMiLRjhHa?= =?Windows-1252?Q?ceqkOmh3mQksoe2rTivA/pUo++1kdrKtz5xpx8+lBBW0wsGivyQDmxlF?= =?Windows-1252?Q?1mIYHh+0HidKfzV1orEKc8VG9YeY4Uuxx3VvbXZq4muUAioxcNCwZDIs?= =?Windows-1252?Q?rI0VTxmeJk8oaHCNxV6DkNLDl6HXNkd/sO6WSmTGS64BYxr51qFLcTUE?= =?Windows-1252?Q?4dgEHsQH5v/JAIgDxVtbLrJZZbigPgEmxeqNxbWkswD2QZpeo/0n6ttM?= =?Windows-1252?Q?z2KJASLllWonIwn+9qvPDGG3uuvDZW/UWL35VqKpIio9rb4Z1octoatS?= =?Windows-1252?Q?5ENRwtvnA1Z9MB7VSM4FcLWFz+K+9dAvd0Iok6eaPoZ6Eq+11Nm3ONUU?= =?Windows-1252?Q?nZBwEBD02QoKEP5uNsdXrhlx2T6W7rwDFm9VT2wdOTcg1xIjQptZrsD3?= =?Windows-1252?Q?80leoaNafHEYX6AAaE6WzjlYHCxnHjl5OocjU6a4yBksYJhZ1FbhwleW?= =?Windows-1252?Q?6EcCPpk+ClZ3CGGWJ7RjgMh8MY9fPAakzSIx5toBkSp6zvA3/eLGLDx/?= =?Windows-1252?Q?Yd1dTIADZsmOSf59O6deCGxGmuDRpyREuYyOC1k1Ldu1y0o8qr5Fzrn8?= =?Windows-1252?Q?Vl0r7c9PLBtpIol9kA03J652qWUArjSNW193KLPosGhe9HYNojJggM0p?= =?Windows-1252?Q?ICf9jg4gKp1iXZ3p5B5npAQkDJi6TaS8a5OjGxW0egBMR1wYx0m5KHDr?= =?Windows-1252?Q?jkzGk0xb6MU1UQjjRwyIKzRWaWAg8U6j2/nDqENpQJXj/4oIuuXwyQIc?= =?Windows-1252?Q?uRWreWubiltF/kHhhdy9kV+u2KKD9OAs6eHDL82tr450A4Kgujb5NKMS?= =?Windows-1252?Q?OdvLJAFAO5jJu4hqd1FiVeTxS+QPrn56y6TVSiykl19kP3obmwwNFI8Q?= =?Windows-1252?Q?o2Kcgt6WxOu0zn6Mq8aCOyicMMtbCPqseJ/SEEakMMDT9ydix/HuQIa4?= =?Windows-1252?Q?BV+7wuxKzhrPqLfh60GBkIA5nSNmoNvwmNiL8JqPyy9b0d9C6huj40at?= =?Windows-1252?Q?tkSTcm5Cn8hRtBXNWZGwonvKMapaNteLG4tKVVGmCLhzECXJsMbsrMjZ?= =?Windows-1252?Q?wvtpL1RlVixlsOEp/rdot?= X-Microsoft-Exchange-Diagnostics: 1;DB6PR0701MB2165;6:SdwDxg9RZB64/IQpOcsBXdmOAIrowUJimaR8QlFd/qos0/C9XBDctbO5R7/q834mtfJe5KotWpSf5OFC+Yq7fMcWPOJ/n91egTfO1Bd4+jEiW0Okf5EvnBniGIhtw1+hc2a6dmxuijKiJSuKoegYKz18kBi2dtzKM97OvS0pc2PddTkk1IteeqgsTn+YpWEadptSYKGev1N8/nl9JzP4Ov9GpBp7tYNeODMp2W/8wlGEIVqFhnQovvwu/vdi4ujbZb+//h2jqt0KK1OhbbjpbIIHP/+53CVsHuInpttF/SMtrFun/zPRsbNIc3a/4zWp;5:EL7nphqBGWdmWaDn6jYCy0iv30WZppOU2bdS0+VMYlY42KyTGmn8+NxSbKd781e9gUD55sXMEj0PSbl6yDoWBZ9/X8yT5d1qOGLpYb0M+6xl7inuMpWuQ/aWVs0rJktItSdB53xNuQWDhwye7G96vkMofu4PylimvJXBJYtnkbI=;24:pMWHFdUp5So6DxTQz3N5iL6vV1xlS+wPWKEilIhHFWSDHxNrdbO2iB6cGOUgGUr9Aj7zMXHoHdhDq82tWHqoZEj3Qh2/dqL0UbRDKpDWYsk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB6PR0701MB2165;7:6oB/BaCeqCGivXnz5k2g1c6/dYy6rfvcVqLMURCevJFXqNULiMG409ji5z0Tx/wPfggEy6nqI5BzLBM1MmOlKp3vjUp6nbNQ5+rQmeBZUWRjRUB7F3EB6PYFSJj5aJ/1cHPrSyJSD+QEZG8H23H5fcyFJwFCRMAfvvtveH7K5q7lHD0FAHikwf3ECNVz0gQKRnpMUcIwMoLt9l8o44a/ZW0tPUOH6mFqRIA+DV+gTJCN9F721H2g2XHuRZ45/oFRRecwcRSKYPFycqc9QA7SQ+tQmmgAo7PjgOFjWiWr6OYg4o9mLI/6rpn+RqlSxse8ldwUuP2QpjWN7dqr3wG+UzZ+oVKBNx4xTttD3ZUgPp0= X-OriginatorOrg: nextfour.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2016 13:05:16.1614 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0701MB2165 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2454 Lines: 72 On 20.10.2016 15:38, zhouxianrong@huawei.com wrote: > From: z00281421 > > The bdi flusher should be throttled only depends on > own bdi and is decoupled with others. > > separate PGDAT_WRITEBACK into PGDAT_ANON_WRITEBACK and > PGDAT_FILE_WRITEBACK avoid scanning anon lru and it is ok > then throttled on file WRITEBACK. > > i think above may be not right. > > Signed-off-by: z00281421 > --- > fs/fs-writeback.c | 8 ++++++-- > include/linux/mmzone.h | 7 +++++-- > mm/vmscan.c | 20 ++++++++++++-------- > 3 files changed, 23 insertions(+), 12 deletions(-) > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > index 05713a5..ddcc70f 100644 > --- a/fs/fs-writeback.c > +++ b/fs/fs-writeback.c > @@ -1905,10 +1905,13 @@ void wb_workfn(struct work_struct *work) > { > struct bdi_writeback *wb = container_of(to_delayed_work(work), > struct bdi_writeback, dwork); > + struct backing_dev_info *bdi = container_of(to_delayed_work(work), > + struct backing_dev_info, wb.dwork); > long pages_written; > > set_worker_desc("flush-%s", dev_name(wb->bdi->dev)); > - current->flags |= PF_SWAPWRITE; > + current->flags |= (PF_SWAPWRITE | PF_LESS_THROTTLE); > + current->bdi = bdi; > > if (likely(!current_is_workqueue_rescuer() || > !test_bit(WB_registered, &wb->state))) { > @@ -1938,7 +1941,8 @@ void wb_workfn(struct work_struct *work) > else if (wb_has_dirty_io(wb) && dirty_writeback_interval) > wb_wakeup_delayed(wb); > > - current->flags &= ~PF_SWAPWRITE; > + current->bdi = NULL; > + current->flags &= ~(PF_SWAPWRITE | PF_LESS_THROTTLE); > } > > /* > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 7f2ae99..fa602e9 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -528,8 +528,11 @@ enum pgdat_flags { > * many dirty file pages at the tail > * of the LRU. > */ > - PGDAT_WRITEBACK, /* reclaim scanning has recently found > - * many pages under writeback > + PGDAT_ANON_WRITEBACK, /* reclaim scanning has recently found > + * many anonymous pages under writeback > + */ > + PGDAT_FILE_WRITEBACK, /* reclaim scanning has recently found > + * many file pages under writeback > */ > PGDAT_RECLAIM_LOCKED, /* prevents concurrent reclaim */ Nobody seems to be clearing those bits (same was with PGDAT_WRITEBACK) ? --Mika