Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752664AbcDZQca (ORCPT ); Tue, 26 Apr 2016 12:32:30 -0400 Received: from mail-by2on0123.outbound.protection.outlook.com ([207.46.100.123]:24122 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752522AbcDZQc2 (ORCPT ); Tue, 26 Apr 2016 12:32:28 -0400 Authentication-Results: infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=none action=none header.from=hpe.com; Message-ID: <571F9811.20305@hpe.com> Date: Tue, 26 Apr 2016 12:32:17 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Christoph Hellwig CC: "Theodore Ts'o" , Andreas Dilger , , , Tejun Heo , Christoph Lameter , Scott J Norton , Douglas Hatch , Toshimitsu Kani Subject: Re: [PATCH v3 1/2] ext4: Pass in DIO_SKIP_DIO_COUNT flag if inode_dio_begin() called References: <1460484775-33359-1-git-send-email-Waiman.Long@hpe.com> <1460484775-33359-2-git-send-email-Waiman.Long@hpe.com> <20160420205801.GA24609@infradead.org> <571918BC.2060007@hpe.com> <20160425114802.GA15856@infradead.org> In-Reply-To: <20160425114802.GA15856@infradead.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [72.71.243.43] X-ClientProxiedBy: SN1PR12CA0024.namprd12.prod.outlook.com (10.162.96.162) To DF4PR84MB0316.NAMPRD84.PROD.OUTLOOK.COM (10.162.193.30) X-MS-Office365-Filtering-Correlation-Id: b5311d7d-961a-4452-221d-08d36df0591c X-Microsoft-Exchange-Diagnostics: 1;DF4PR84MB0316;2:52TTtwLvYjNVtjClA9Ys72XKYQD6qPz5Hq9t7T5tf9jWM89DbHdSmYA4MVJ1tBdSYnXBE3ps9ZP4aHfv4gPQc9pEdmQO0OrD5Gg/wB6VjRwACSAA/4XZIO8Nw61sIpOa9yQsdGggLSEFNmMoogGrXNff2MCzTlA+2vOpZfqjk06RxhICfLDAIZwSro2gzvF2;3:H3Yg23eE6DHAUrHLTMessjxbaUfv6gFlrc1MmDxPRzGI7z1ibRaDYruUqZEFKTLhptXA3RiGHpxMVfvBaItHy0IGcO+8uZ/m+kiZ37Mocg0IjryoFV29q+bzdKwJxgUR;25:0ISGmyL4jzufxS+9a0wehY/ZTxtFu8TDvWPqRMWg/uS8Uy7DejhlHp15zq3EZeBAHrN0CgTKg2i/sWtB/kdONlQsFrMfzpqQ612xNlmUHDvsjhx6yUnswrsX16Qja1zuKE7lLpj0bV/YAZ1MTDpI0Mthz9zzZYeDbet14bYBOk3vh/yUzNu0wYlENQxC0Eq/6Qu5VXvQgab1VOYCYksxEkY8tZoLWxNSRk7NzdHS8F/5oLyj1TL8QIe66lRMah5VC59mhOXOgKFCdlDGymb0JDU5lBpJ4MfbVg3vOn++l2VSfwGESoY7A9x8IkXIyUVBktKOts54+OyxTmNTVe9bUAiGxM0EF2uXQXjxqkK3LVxRRSOfo/0VEtRU8tYO1y1rTLuoZ3Ts4kXaxmmg4CMRvD6jZBu0WsloNdRzwoF1M++k4sp0Vnoq+6636jqzYYFp2dm3IDNr/KQsiFrcqyh9QTYOmNtE2MCogI9Q36P0jZq+P8SJUd+QHl5OK69hE9OCslJS63wh4THW+uns/diwjw7QmanvPgwv6+6lK091cYV8Qo3ZIO+5nVJPs25nKxPK0D8gL/x4z9pWx7w999+xf6Yq/FbLTNydtSLnr+exnlo3qdwv5LufMov/0UP63SAb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DF4PR84MB0316; X-LD-Processed: 105b2061-b669-4b31-92ac-24d304d195dc,ExtAddr X-Microsoft-Exchange-Diagnostics: 1;DF4PR84MB0316;20:y8q2qzm2WG+2pgI7u2/blgUG/MLVXAA180UaTVjx0lIwyCVVh2gPrsqe7TXXKqKzmTH//69hXRmkZRrrfRe7cEHNnNOln47iCScpvezhqe6DSBBwH6pK1DmxNDoK4WRX+y0SjUgiqoxtb+79ZsOR0GZsYMvuqv0R54tbnw+sNmK7Dme1ZAM9a1a6mEVEBKSdnDoLu3lguq0X1QR0IgEQA+/0rup53BsfRHhj6ZFScv/zK1N7Yhhz17g5Ki+hptq742qQ0DxK1OCO8i+4dj5e0nTtgkEZ9q5aAywI0K+C7Us6YfeHjK92Os62uE+h3gL0SLgEAMGhzE17hkUQqi7+lA==;4:FiJZWOZR5kbYQOa8eoJpiuTFEwVcXjmjPi60DQWISR5A9kJzbf/r6fGrgmD49vnhTiIp7mGJap2NiiqWMEdaFYr8pPqKpkURovLvV00psenhltW0A0JKhVojamIs9+g8Ba6lW64/vgixAZl1XgJXP6YQGg7M/1QEQSYedCBJAgzlIcrqdhr262tO3peZd/gUScYEpf2akvT7XXoTJczd563WLncTheZo90nqC9FTOkmJ96nrq3Pgfdpt7p8Nk2E32eBD07DthqlyZ64VfFbAbzpyBiKe63vDV/Hpeih+pkRmFsqpK237FHw1OAEwlA/tSSCfNedtaHPte+ETEfyOhVTm7ZOm4aXd3Kg5Oh3bBAsVfanuK0wYYUmO0JSTn2QJrMS16yepItzOGpa7D5XWZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:DF4PR84MB0316;BCL:0;PCL:0;RULEID:;SRVR:DF4PR84MB0316; X-Forefront-PRVS: 0924C6A0D5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6049001)(69234005)(24454002)(51914003)(377454003)(66066001)(65956001)(50466002)(65806001)(47776003)(42186005)(33656002)(23756003)(64126003)(92566002)(2906002)(5004730100002)(4001350100001)(110136002)(189998001)(77096005)(2950100001)(4326007)(230700001)(3846002)(6116002)(5008740100001)(1096002)(81166005)(50986999)(76176999)(54356999)(586003)(65816999)(86362001)(36756003)(93886004);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR84MB0316;H:[192.168.142.162];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;DF4PR84MB0316;23:85S57MZPdeG0/uM2wWvkd2wkGAKTbDbIk2Kz3R1?= =?iso-8859-1?Q?dfYS53LdQ99+PbQEuRrKRlPGE04GEIhLKbR6AY4bRfyfRDTQ5zVaYhRPQ0?= =?iso-8859-1?Q?wuxOdbAg3Yol4qK3HLs9nqM4ae6lvQMtIbPfY8voyAiod9Agtq3HSkC/Nf?= =?iso-8859-1?Q?4eKqkr2xDqWx3Q/UVotmR0pCIJBFGVzq8iq/kBk8iy8CaEhyBeyQCEWabA?= =?iso-8859-1?Q?Q3mz6HWmZOjf1Tn22WJTeni/XoFvvY2DTiy5S6Agjn34GTPdQYD9qA1Si+?= =?iso-8859-1?Q?uIRc0UdX4hbR8hCjNUDCnftTbeu69mU4/nNlxwOxqYqX0plrQ1WPTQ8qu1?= =?iso-8859-1?Q?gfajIEZJ49eR9BwhoJqyX+A90zwx/GGw+XuhwPBFpi2Y0iHqWXAajb1j9f?= =?iso-8859-1?Q?YyS4HdudFdukrO4o81J2E7+2GPLqthgP08yAA151fmu/PF+ZVYBUoiO4v/?= =?iso-8859-1?Q?njIic8CFiTX/fVjyidZ/jZgsUNBSZuR/5XeWFZYJpePfsEK4lyR95z/9ij?= =?iso-8859-1?Q?WIakzvCbewopg/FxPhSL6vyaBlySTfa89bMu5Zw9yWp5z+IuJiGjTBc+pv?= =?iso-8859-1?Q?JA0YZw6G5u45cbRy5fggKDwT0FB5w5yITzZzxztD1nyHb4OePiuvd/HNUz?= =?iso-8859-1?Q?ZlN/IvGZIa7JzSOX3Ehl9mijkvgKM5hOsbuHhoUMpOsLTsgb0XtEUu22Jd?= =?iso-8859-1?Q?wxmPocpWug+y6AMBRpRgSee7Yp9V+uLrrNtwMIIcVWTMqBGWXYa0lhx/gr?= =?iso-8859-1?Q?YiZ5fqXOum9IadBQOICQDFGwPaenr5CZ7j0CMxoMN0sM5JGCxjhTDEIKc3?= =?iso-8859-1?Q?vxKiXDv2Xn9JYSjml/l7LxIpZiNYjw4YKblRFkG7QB3wlgrfVsrv1dJtg6?= =?iso-8859-1?Q?tQU4Kj9xjqShR1nHwN/Sl5AVZ5I5pWU2LstXF/SeoRC9ygmAtlVZolKBkA?= =?iso-8859-1?Q?Z8vpHOHtZeNhmYRVv/WrempcJO0ZjPrrST1Wc+9PYi2FC4pRXouNJWAKSo?= =?iso-8859-1?Q?/3guw7NGHjePEufNWvFPyJZCXAJiHw/FUNmbFllrK32U6zE0gjifUcMQe?= X-Microsoft-Exchange-Diagnostics: 1;DF4PR84MB0316;5:at3AVpn+lC85csm0YL63Mz1zKfff2ZThjE4CBKJK0CraWdcIpyIMkSLZys4Mv/fCLfkZ/vUQmreMatquOJVlJ5pzaCCtxrQspOkW81Tr6o9sgUxEbbsZPKFwKIDyZbYvi9GeN+qXxes3IB7ImIPETQ==;24:eEUgg5YdjgCCs0mIYcTLuNU3zaFkn1byJdc7UEx6kuhGvA2ErHrrW0MbdISX9YSub7OAHxSHe6LnU0POeYzo7TlVH8nzCKXvwMskfBFRCxE=;7:Cn4qawZRrF06iQLroMwoTSG/lj2VDaZCbu7g60l3nCSiDCtNA+DG4s4Dth1uuJYdjJWhE3Y3nrHqtCibrTreo1ms4E4qdtECDWLPrtRRNtsHPMbW+HUw7itC1XChnwMqs5MgTyRMm+/bKk7wOd+HSTz1uG1DWAmKKoe7TDPRYrdP2naakUY+2NKkUKOIzMUq SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2016 16:32:23.4278 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0316 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 26 On 04/25/2016 07:48 AM, Christoph Hellwig wrote: > On Thu, Apr 21, 2016 at 02:15:24PM -0400, Waiman Long wrote: >> On 04/20/2016 04:58 PM, Christoph Hellwig wrote: >>> FYI, none of the Dax code even needs to ever touch the dio_count, >>> as dax I/O can't be asynchronous, and we thus don't need it to protect >>> against truncate. I'd suggest to remove it and then end_io callback >> >from the DAX code entirely as a start and then move from there. >> >> Yes, it seems like we may not need to change the dio_count in dax_do_io() >> after all. BTW, what do mean by using end_io callback as a start? > I mean to remove both the i_dio_count manipulation, and the unessecary > end_io callback from dax_do_io. Thanks for the clarification. Since DAX I/O is always synchronous, the locking done by the caller or in the dax_do_Io() for read should be enough to prevent truncation from happening at the same time. So we don't need to use i_dio_count for that purpose. However, I have not understood enough of the block IO layer to determine if the end_io callback is really redundant. I am not confident enough to touch the end_io callback. Cheers, Longman