Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934553AbdC3S13 (ORCPT ); Thu, 30 Mar 2017 14:27:29 -0400 Received: from mail-ve1eur01on0094.outbound.protection.outlook.com ([104.47.1.94]:4748 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933378AbdC3S11 (ORCPT ); Thu, 30 Mar 2017 14:27:27 -0400 Authentication-Results: linutronix.de; dkim=none (message not signed) header.d=none;linutronix.de; dmarc=none action=none header.from=virtuozzo.com; Subject: Re: [PATCH 4/4] mm/vmalloc: remove vfree_atomic() To: Matthew Wilcox References: <20170330102719.13119-1-aryabinin@virtuozzo.com> <20170330102719.13119-4-aryabinin@virtuozzo.com> <20170330171845.GA19841@bombadil.infradead.org> CC: , , , , , , , , , , , , From: Andrey Ryabinin Message-ID: Date: Thu, 30 Mar 2017 18:27:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170330171845.GA19841@bombadil.infradead.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [84.47.128.244] X-ClientProxiedBy: DB6PR0501CA0032.eurprd05.prod.outlook.com (10.168.78.146) To VI1PR0801MB2062.eurprd08.prod.outlook.com (10.173.74.147) X-MS-Office365-Filtering-Correlation-Id: 866aa526-eefc-4516-c738-08d4779a6964 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:VI1PR0801MB2062; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;3:NkSNjZSzxeyfOO/Wlp3zOMrvt1dNgthmuEK2FEnOV2GpeKv37WDyUxxcL5FYB576HUfpugjvicAjy5pF37AyN7CX+4K85wQ0rglx7Q8wBAPJww6QH0QGCrz9wApQf9FGbbZl+fjk+h3QjwhNW7hNeKVeiT53r1j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pd9tnE+OboEgX95wEjbSZhor2VsfGZRX0DqruBYLPNj1qEMMnPHC8jCAkGFJQunBWtIrpBpak5lxbLeeuQVTuhSCqRWTzodHmEfe+zw86bdi03CvqFpPw3E96aWw2YqHAmKIBnkcD0UwRHh7u5YrkpHTwBwCQsAWYxTOBgY6iC8buAYwJRMJaJ6IJoo4B10D+YrC2y5qY7BfKKACXZbeZeASZdUl2fsmcYIhxp5JKss1OzbDJhQMXXkfb7bUN1lcJ6W/wiFj4o1gKj1W4Ry/xkIJb1UcN9k3RRkskqvTrU7x0hSmB3Sw1LwwiHLQZTE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(20161123560025)(20161123562025)(6072148);SRVR:VI1PR0801MB2062;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2062; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;4:/3Owyh75muFm6iXRRaZIWua8/TqwJ1rCNocX1YAzYZJ0/rBcuMg9Pa/fJ5r9esxxml4+h92EEPh3yexTpXdiqiOwu8GiaItEwQtDB3+sFbJMqhj9ydZcJR3OGHx859qhOGBCvH3mJS/H7HMarhlrAIa3aTSdzVHOvNNFGXj7lgdcRaWe4MGicqPqHosdx2gMcCdhqvOa6CRZIwb/tpIgn8jk883YQ+q4EijTmE3aAFmFjP+nwY2mnNqtMNoN6NTrkZ0RyO0qrdzYslWvPf5sYOYugw5aIQhiTtUmaZpDvnmdcOkWlq2b5YSdlGo+3x7W0FlZlvOvh729P7eN9fjJSp9jZ4BhiRMstdfanyEHQ/Z8vwMGsIMNn+mq0uqDnU2qLb/BYvMItYd5aIr9myWrObGY7rUxMimE/fwOv/w78YQssIt8vtM0XDuRg9AJZreAcXtqXD0gZqKtDRjUeEn5hdBmiiCyWCaA6vUpjt7rWdwfpHU8KIGPlyya0Ujr7i+GvJ+1LSOidxYMkzGoMUElpg/E7jfRFYjDIzQ7J9TSy0d/3v+IFtbgCXOx7L8uYWVBd/LZcu7fHTcFNHAQOqwb45KVrWhiiO4YiJUe/hr6lLOm9F+Z94kH516ONseWtW4sK+u6C/Q7BpRQP2nBKgly2/tOTisOBwEFGwdrFf8LXr8= X-Forefront-PRVS: 02622CEF0A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(39450400003)(39410400002)(39840400002)(39400400002)(377454003)(24454002)(23746002)(2906002)(53936002)(81166006)(33646002)(4001350100001)(31696002)(7416002)(7736002)(3846002)(305945005)(230700001)(86362001)(189998001)(54906002)(5660300001)(6116002)(8676002)(50466002)(25786009)(229853002)(77096006)(53546009)(6486002)(6916009)(2950100002)(64126003)(31686004)(42186005)(90366009)(36756003)(38730400002)(110136004)(6246003)(83506001)(65956001)(66066001)(65806001)(47776003)(4326008)(50986999)(76176999)(54356999);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2062;H:[10.52.82.106];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR0801MB2062;23:3+31OWr9Mc8Kq5gEUlOFM3m9RDe4QH9rDNX?= =?Windows-1252?Q?+JkiAVdRWT6ScI2hPDe4MI2IwQjAgsvnur/2tiVugYSfrur+DacIUTkB?= =?Windows-1252?Q?ZX/rex4w+RxncXbUkLnoQzNEyS/IARr9KWzvs/8ZNXRPG3lYF2vDhXob?= =?Windows-1252?Q?wiJiYYFWpbdn4RROgbgGMGXLKVMDV16nw+NCkqw60fABOCVK+Pe2Ukul?= =?Windows-1252?Q?CrHl6VHNER505FrJOBVgZgtjvZLLja7qsfs2G48hUN9dDIyC18RWX5xQ?= =?Windows-1252?Q?15gHBFNqdu9JuPmF4/PWRKPEN04cXGuMNfwf8sPbf+z7XqIcLDLR7sRK?= =?Windows-1252?Q?ZxbG8KV52qSLD43VWLSeN6gdrzdluS1HFAYl2vOOQ+5tyGu5LVElMbc8?= =?Windows-1252?Q?8XDIfShdH/4ncvfmyHX9gOcWmQbJpA+iN6+YUvtQ6Ag8fulCyMrIOK1m?= =?Windows-1252?Q?fb+XSjTSwQncL+KrfUMaZyn4GjqRJdMiWivgjfzqQa6dOELvOkLk/TuY?= =?Windows-1252?Q?ViUTnpoeVkuldnuDoNsCO50g3/yX18Zb0INPTCNKpe6cEt0yvmh4zYpH?= =?Windows-1252?Q?Md9mAhqu3GoFtjCZRaIir2Yucmsh+dPIRRT+piWlPUc8fYfgWk9zEIyQ?= =?Windows-1252?Q?B+WzU1m6fCGaGZ9MlNU/0NwhdwfygAqT8BwIbJrzr9KGhHjDEV3dKa4e?= =?Windows-1252?Q?IgjYszKYhTd00zDmZIm61Qoaoc3O58/g6B7yvxUI1gBPBosZN//F0URL?= =?Windows-1252?Q?Zy+tHaMSiKDm6nZcmbExhuoJUSs1VpdpiM1/NQyyxNIH4u9/AG152yJJ?= =?Windows-1252?Q?MAOGDVkjB6yM0i6D4HE8a4RuI8TFs6+27nNmZtQdifpkbyBmVIY/kPF8?= =?Windows-1252?Q?PeoUfnSsnuNKGnuwi/MYSJBQsMi7TT2I9dhcywG+P0AlRQC7/iFtZAI5?= =?Windows-1252?Q?VdwOsyvrmgcbbrmbvWe2f8OFzYjG1JsmIzipPcYlG0rj4B/6tJ1S1U8m?= =?Windows-1252?Q?p0h6zohjGXrY79kMKD6KiXKzq/rox1nvNgmhGq9NScQat3FkjUqFYG/w?= =?Windows-1252?Q?eXDigiy8Bo1CACp8ioSZ5k/G4/+DB/sGjBXQngBTFmHMqO9DYLchkCkS?= =?Windows-1252?Q?OJwxeGFNWxeiBY7HHVgXy3a4vIOa0LmL2F/oRz6pU0Ur0B35evFj1Rj2?= =?Windows-1252?Q?zt3j6fXFVc1BrDS+h5rBghSlMCvkwU5QQS/RCPcMq2GBbIsSedcfsJhb?= =?Windows-1252?Q?Ex0m/Gr4T2vxulkRa0SRJjug1+brDSujD/hIZz+LZ4m7uBDGpxStKR/K?= =?Windows-1252?Q?k3A2aCQViCS/PvoAN5u2L6z2+eCj04tjpiWFpw9+tbKtHl3xyrW7YI8e?= =?Windows-1252?Q?bVsJKHXPv0vnf?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;6:USd1IhDkGfcF5FvTGETbEdkb5JiDgvpD+nDNifJjJlcqkdSonIMAephxuof7M5e49nUblhh2cgQLUo6fnhSua10phpgBw93TthM74eSwEUSeyhRzaFP3SCh4Oq5LxeNcAV27uyjCI+lQynnwGtrw8XvYlBMpcrmjLPaCO3m/wa9Gn0yfFuQWzd5Oc015tNPhAlRg+NIqpYmIbn/z9H3SuoIklwuxBdCoOv2i8s8XJbPllyIU8orPUbRnGrwuorBh1Fa5WznDmAenSJOpogiQAFMeLtWckLKwnNOmv7pjyaFVVUEpDDvFuxBevO/kb33x9E1aVt/ruW52r38IK72Ol/Xni4SHrjS8fPhDZ8A8uzIF1tLAEW110FgqaFs0thW++qg/7KiAQ7ase06rdZClyw==;5:j9NTZ4nfZghZL5CW7ZLI9zr5FUqRB0JD8hZVmgdTq8/sxL115q1iYV5ebyeNxFnGhn6jbkDbU8HuM9lFLGEvCxPmoh/3lv13KnWa4hxmSNIYHkGHSSEN4nFk5KsuxqLeRLAZPGDNZUR7cy0LYPFLKif1qaikeJdgSyQ138lvWlE=;24:mx61dszD/CYSBdbk5Vka2R5nvjUdlPwSgevU2xquBCrEGnay9IES6q7qi5jksf5LvwK7S/XvzQYldd/2S+iLyr81ThVHORDQ8YeFd2H7jfk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;7:oEMxqUoNBrMTQYMxorDU8f2ubSYa1/4K+KFVWnc3+qfBEXImDdOpkkEB1yvatQrUttQJywlbR6+EiJDc+ztEE+MV9gJsTw5y2M8I9qcirY9DZ91MV2fVmQP1mCQnL1lcp/1yr3j8tlNlzw/qqxqSlROX+VJRLEEzpqDb9wbM1R6qHYchWeqV2fp1y9p8A4+lHmN9KK9idls4B5EBH+SpI2TOK/qnon3D6xPy/31BaH+RfHQIDQ8CSBX9kfOmnczdUG+g3Nhzq7bl1Uar4W8R4dNKKNLcACPgd4dE52o4+2+wq9hlMTvp6DR9WF4eKubofYh9JZjBk/U70pDAx4dDfQ==;20:QVotq6W90ztm8lDZM5UpEo41HBSJia9tAvpyqNZ81L43PMiEMcNMHfQL8QDsW46+hskmuFEsGIHHd7DfyJHlRmPR2Yg/otFpuSlQ4tApPXMwRAnPt1/SJJUS0LP6zOXyt9of5U4wwqZJWCNJ1Oifotl+Kins3QnsEiQyURDCe3o= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 18:27:22.0765 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2062 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1028 Lines: 31 On 03/30/2017 08:18 PM, Matthew Wilcox wrote: > On Thu, Mar 30, 2017 at 01:27:19PM +0300, Andrey Ryabinin wrote: >> vfree() can be used in any atomic context and there is no >> vfree_atomic() callers left, so let's remove it. > > We might still get warnings though. > >> @@ -1588,9 +1556,11 @@ void vfree(const void *addr) >> >> if (!addr) >> return; >> - if (unlikely(in_interrupt())) >> - __vfree_deferred(addr); >> - else >> + if (unlikely(in_interrupt())) { >> + struct vfree_deferred *p = this_cpu_ptr(&vfree_deferred); >> + if (llist_add((struct llist_node *)addr, &p->list)) >> + schedule_work(&p->wq); >> + } else >> __vunmap(addr, 1); >> } >> EXPORT_SYMBOL(vfree); > > If I disable preemption, then call vfree(), in_interrupt() will not be > true (I've only incremented preempt_count()), then __vunmap() calls > remove_vm_area() which calls might_sleep(), which will warn. The first patch removed this might_sleep() . > So I think this check needs to change from in_interrupt() to in_atomic(). >