Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935760AbcJ1O5z (ORCPT ); Fri, 28 Oct 2016 10:57:55 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:51179 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932740AbcJ1O5t (ORCPT ); Fri, 28 Oct 2016 10:57:49 -0400 Subject: Re: [PATCH 1/8] block: add WRITE_BG To: Christoph Hellwig References: <1477515135-16469-1-git-send-email-axboe@fb.com> <1477515135-16469-2-git-send-email-axboe@fb.com> <20161027063717.GA1165@infradead.org> CC: , , , , , From: Jens Axboe Message-ID: <4ae57faa-2f69-98cd-e276-1e091a6922b0@fb.com> Date: Fri, 28 Oct 2016 08:57:07 -0600 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: <20161027063717.GA1165@infradead.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [216.160.245.98] X-ClientProxiedBy: BLUPR17CA0083.namprd17.prod.outlook.com (10.162.85.179) To CY4PR15MB1189.namprd15.prod.outlook.com (10.172.177.11) X-MS-Office365-Filtering-Correlation-Id: 6bd85b85-1399-457a-548b-08d3ff42b3ed X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;2:NC4AH9cK5SoCPdO6G443c4xyOmXwMyHapAXBlfLYtmHneSE8XiqjwxxwAGmMpUz32kwrxTaD8WOa+R+p8Vvcpi5TT7xLbsNa02XGxPfh8FzGlwIEhRX5I0Q05wk7rWpDvGWxqGsJc82IU2tWPJu8GXBbJN4TvIA4HWVBfF2VAzE6cjjmcF2GPxxhJK2WKsyAzILq7ORPbbPb6H/Lnu2EpA==;3:EwS3AdUoVwLkwCoPYi7myiAOM7Fjctn9Pia2Pi4vxqyj6GnkFZqw/806BhvOX5RKE+iy0WWEVD9nDcCCPn//ZzPNqzmY4X4uEEuG2Pau8nDfamUXBmzDlohL9HRvrzkWoE7+Na4iusDGICflB7v40Q== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR15MB1189; X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;25:d1jdHPideFGuQT6OqGtwCmRU3RTKUKqhLTw+GIZXEOpk+siByHm/zj6MN/e+yHikbhxMUptuRnwbrI0iBckgcUYrvlR3sJJnGykIzZv7mg32VpHvJbRBUN6P1rbOUUg+gdZdI3PVdtgDOeCgonZY0c7GxN3nM6HgkR+c5GeRahobmyDGQuZQ1972NLvdPnl1/Lee5bHqRqm7/APZMA1dWbU8CSVREvzx+mZiX4U4owekjt8pFRX/vo0DebM4Y/E34KwE3i2R5gaWVWkbAXiePBR4L6jHN+hFxhkMtxRWZKxSHOiEPp+/FthzkrAWEuWpkTYHsFJxOvBI+b3LaUtQkL4sT6lU65C8lH/ojRxJMf8eo+3Iu+X63WTnKvaVdvBYCepFmsGp0y0em+tCiHUBaltPy8yhfPHJshC4k9EymZLdny1AfhJHvcK9WS3vHX9V6kTlpWgFxIDG1aLonNZRZJeELP1yAmwzneNoyoUN+Ocj9RftM+Cy3G3IBZYwKoRMN9UNv9PDQc08d2iUKgBViy09zzA/b2Y9B+ZMyXSYz/4RLkgQgWjZ+EXKu/mVkHWwGFEWBlPerejEtrcM/WNMGk58puneeMgZzGBInxy0Fplc4EICN5RsZ/QEgBtP4B2bj7rw/JgkeqjI6QgPbIeELdbzrxZj3pmugLGEviE/OI83AipKtJl3MYL1m+9u/7RBs30aPWU6YAJurJiC1Nm4CuqvXGjiaXqGfOq4fjctenb88QHR1LUeqqnWsmBQfEf3IJ/jeMw1oLi7oSLapM0OjsOXylLYbJI74kfMB/BnTq/sjmHvLBahlzd0gqA1w4zd X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;31:xhOVVr9m5XKMt/NjTrut2/nb/qKZ4l1A9JP0fLubIvImvnfLx2mBJqr179c4L6Bj6TDJ0eGTQ4DqVX8jkWMCYQk/Gt3IGFCjm1+ruBQ/cbIX+WcM7A9ADhPj56psqRysz8iOQS4RfJYiZNr+1kVKFu7Enwr9i7KHlySol2qPggxxrjbiawL+nbCyNvAXVOpq0mk0wTfQjUABIcSxWfuSm/258gXTEOcf5EyCRYTiUuoM/2sWx7PakXFiJD3oDcBC;20:j7VciMGtLa8GkgqsHm25uVDJtyh9dV2HnKWu5/Dk4wfpyFNXRMYvxPjdB3t2/Ysg8VW6Tt7wa6CccK3mf57P0r8MWV5tB7m6iQrckqaTe2eoeCTB/FZqykXeBopLH/s1FwTGek0SR3hyQ2s/zj/Bp/GhbH7CaW7RfzcIdaOXts0=;4:ZG79l0lBig5O5ajBhZMCRbCZym1kXuOwUghXjbX5EYdoerM2u9ZlgwVQ9PqVfHSfTLrnlGbN0HP6szJmNzsooWdV7WeB3k7N7OSowMNXdp4Ek4z10YTlr15Rj3bj1qGSgr/0RVMrrnWtnr2eUhYl6I57yTjEy7BeQ+hifKFUe/QGZTIAht6pweyJ3Mw8RnJs1KHZpdPT+X09izsev/yHqj5G1ZL+LcoEjLWQULpByTesL9Hw8OniCA0gaZtl+WLexgJDNeZ6q8CsP3eG4UCWMgVSEGmqZ3975alnWk9WvJ7i43O+JjSo2Sjaf2qSaCINzFN30WOfV9Z6A9zWBMyC/YZwMlH/d8gps6W/KZ5MWvwOmWCyngYng4rpfyGI2bTAjsh4rnnMJzRl24CvL/6aUg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:CY4PR15MB1189;BCL:0;PCL:0;RULEID:;SRVR:CY4PR15MB1189; X-Forefront-PRVS: 0109D382B0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(24454002)(377454003)(110136003)(3846002)(4001350100001)(305945005)(117156001)(6666003)(7736002)(50466002)(2950100002)(97736004)(19580395003)(189998001)(6116002)(23746002)(586003)(33646002)(77096005)(36756003)(92566002)(15975445007)(83506001)(81156014)(8676002)(86362001)(81166006)(65806001)(31686004)(42186005)(31696002)(105586002)(66066001)(106356001)(2906002)(7846002)(76176999)(68736007)(65826007)(4326007)(230700001)(101416001)(50986999)(6916009)(47776003)(54356999)(65956001)(64126003)(5660300001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1189;H:[192.168.1.153];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY4PR15MB1189;23:8E8L3+cTPqEOg4dYAweityNjxV0L4Q5JsQnXt?= =?Windows-1252?Q?O0r5b13ghVb6qonlAEdhcgzwwGTuGTjkOkr/BTU2Sx7wGgFyNCQLG8GJ?= =?Windows-1252?Q?WMwaN/mUZwXAdQ5fBgNTU/dnaOjW1ug0QOFhpkJh5+ZgYzwH1Om73/I2?= =?Windows-1252?Q?wGpiLNkHdTWk5py+LshcLKkPTkPnyk24shg6X7krnFV0eTKOw83qQ6BL?= =?Windows-1252?Q?00Wxyo8VjQXnJMeOo4pdXwS8Naum+dMwBJH0k/t32691BQ7LCB/VGzvx?= =?Windows-1252?Q?+HQkhRdvIJmxLnUpH1V3Ejhxow23fm9MBTFYI8N3q18TJrXgiy7d0/xY?= =?Windows-1252?Q?XAubhX8LU9NzX5ZSOQ/L58fZUkTWD7EERFonKdWfObkAzFUjioNvuNH3?= =?Windows-1252?Q?wmcN/31sxGRRo+3VLhRQHVeEQkaVxzEDZJXd74S28+MM9dAQMdIUGEnD?= =?Windows-1252?Q?T9qSC23o5rchaVl1+wiCK7ZNZHF9870RixEOlS2ahHfWuim8aDdiNb6C?= =?Windows-1252?Q?QHlFxX+X8dWk8/bIuDEjKlWTgGrMxn9HyYExrKhfKOm/OlFzItLvUoQv?= =?Windows-1252?Q?SGgcencajUDGiiMWHpUE0Bk4IRpnMJdnSkMG9yTJuEwWy+ck9qshTB12?= =?Windows-1252?Q?8n1kS3q9YgN7a0dtzM4qOLZaYWs4x9F6E8Wiyy+yiu/1DKp7GxHT6Uss?= =?Windows-1252?Q?soFv23pOj9wTzS7rk3C/ubpP/GQdwwN64vKPCMWxgfvtgYaf3xgrd1tA?= =?Windows-1252?Q?a18DUCssVvDKptcGF+CrFqETQ3C7uM4J8oUw5aZwpmyPI8GcewvjRKAP?= =?Windows-1252?Q?WxyseoGW1DLfCLqPOQ9mUV5QEPkvJQyThlxly5VvJMYmKail2xIbYyqT?= =?Windows-1252?Q?dgtsFl3MOTSrDK4Tk/XjGnVnEZzqQm7/1MPo3UJLMMoolSwebZamhXw2?= =?Windows-1252?Q?wOhphuu8Z/JmnbcuuYdbXCJBn4jy6NNdicbDe3lF0M4XKhUA6PkVrtnb?= =?Windows-1252?Q?cjaBY/a1H4zExBBczuwJ79Z9PTQlOR4XnKKJetjBZNly9PN0VwMKnCR2?= =?Windows-1252?Q?oO65iTY6GAYg5x0++sZGZlcRmMVpZW4NJSVQwKG+Mmj+WNKCR9TM/OQ2?= =?Windows-1252?Q?4fojwjHFV8yAOXxyMEoHVW2WTZi75rHHbSew0KX4ZHCFfvFgQndFD8N9?= =?Windows-1252?Q?eNbfXZys8MDfbngNfO2JLRaEPtCMg9vfFjG8Y4kB1SGXXSK0LUxSOc8P?= =?Windows-1252?Q?zwl8Lc3A/x6RwHKNwARBQjNYpqGx+ZZQqW+UpGqWN/tbFsmhKrUsuejL?= =?Windows-1252?Q?yOeCbsHqasyD7EQVrFdOjTq9qTfg8TPYZrR/dhS0rFLoQB5lNDinLgD1?= =?Windows-1252?Q?PgwzLb4Lj810QwZLpO1+qjdGWwMZcMuVqHHXrtMNRE0+NHtCaCXhgj8m?= =?Windows-1252?Q?NmfmfymOATgm/YgXhruukIPOiAEsckc258P6rBNVA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR15M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DDDpjOP1i49QavAPaLGtA/Z+4d+PS0hzbxHNCKL56TNHHwRRPgG7j+MaOlmeQUDg6w1EbpykyLssdeupfY+fD0N6OMSkE3GM1+4OAQ0EC+oGZny9ESSRQDmeoY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2016 14:57:12.5518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1189 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-28_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 34 On 10/27/2016 12:37 AM, Christoph Hellwig wrote: >> * non-volatile media on completion. >> + * WRITE_BG Background write. This is for background activity like >> + * the periodic flush and background threshold writeback >> * >> */ >> #define RW_MASK REQ_OP_WRITE >> @@ -202,6 +204,7 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, >> #define WRITE_FLUSH (REQ_SYNC | REQ_NOIDLE | REQ_PREFLUSH) >> #define WRITE_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FUA) >> #define WRITE_FLUSH_FUA (REQ_SYNC | REQ_NOIDLE | REQ_PREFLUSH | REQ_FUA) >> +#define WRITE_BG (REQ_NOIDLE | REQ_BG) > > I've been trying to kill off these WRITE_ flags as they aren't exactly > helpful, see my branch here that I'm waiting for the previous serious to > go in: > > http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/block-flags I'll just adapt to whatever goes in first, not really a concern for me. > Which also begs the question why you add the REQ_NOIDLE flag above, as > it's only applied to synchronous queues in cfq as far as I can tell. Right, it's a CFQ hint. We only want to potentially idle for direct/sync writes, not buffer async writeback. > And while I'm at nitpicking about the most trivial patch of the > series anyway: any good reason to not just spell out the "BACKGROUND" ? Sure, I can make that change. -- Jens Axboe