Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753373AbdDDJtZ (ORCPT ); Tue, 4 Apr 2017 05:49:25 -0400 Received: from mail-by2nam03on0066.outbound.protection.outlook.com ([104.47.42.66]:60256 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752545AbdDDJtW (ORCPT ); Tue, 4 Apr 2017 05:49:22 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=vmware.com; Subject: Re: [PATCH 1/4] mm/vmalloc: allow to call vfree() in atomic context To: Michal Hocko , Andrey Ryabinin References: <20170330102719.13119-1-aryabinin@virtuozzo.com> <2cfc601e-3093-143e-b93d-402f330a748a@vmware.com> <20170404094148.GJ15132@dhcp22.suse.cz> CC: , , , , , , , , , , , , , From: Thomas Hellstrom Message-ID: <2b95af00-e4e6-4df7-7cd5-30b4f6980b09@vmware.com> Date: Tue, 4 Apr 2017 11:49:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20170404094148.GJ15132@dhcp22.suse.cz> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: DB6PR0902CA0016.eurprd09.prod.outlook.com (10.170.209.29) To BY2PR05MB760.namprd05.prod.outlook.com (10.141.224.28) X-MS-Office365-Filtering-Correlation-Id: ef6941bd-8785-4497-165b-08d47b3fdd38 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BY2PR05MB760; X-Microsoft-Exchange-Diagnostics: 1;BY2PR05MB760;3:OdUgijt9L/vuZiGmLUYGm+pRjJWuAxFdKPXC3Cakmd2+oKPs3Y3EEzU6VvsmslI59qIfVI+YH9ftAQF5r6GTcIFDRJt5mBYSKXt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5JxwdV3EKfNfPfQUmpP4TLaASCgI15W1IV08OKKub6WOa7K4mJUw/RIMmYBNRMXxnRsCEv6mvLNbN5dP/YwzyprklBwzQBevt26yUzxN3zTyV6e4y7gyy5CYNPBaPdCQGi2sh1xuWH3l7h5nV+NdQzXNvKUvbit58yOW/isZ9sFZQX8Hs0+lDKSaGrh2d3MdlLPgTN+bSptee2haMKj1voY49u1tYb2cG1RrNQn2urjS3kmzfG7lRDMbrUeZBEpUwmEPVVE7fNxzO4RqkJUAjm5P6msYxrv7KNY+87g1kD2mYOI18Edv4CFsJEtdWfeWrVJqynK8NbUSWSigSwk4eFWKjjxS3emfrmwjtcZQ6JDDaEJrU/mwZbx94+J5vC8rtj7fysPDev0z9W7E51tUKeL9K2r+eeaXs45MFO7rAEWwxhBu3UblNgZN+nx6398dKR8qnkgK 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)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(6072148);SRVR:BY2PR05MB760;BCL:0;PCL:0;RULEID:;SRVR:BY2PR05MB760; X-Microsoft-Exchange-Diagnostics: 1;BY2PR05MB760;4:2HmyJx8h9r55b/KTOAULz+IGsW/yt3wcPM4WWrOYiSLP5XhQnp33jhaJQbLX8u3SATzC7dtJZCmZBdoF6DBLr2Zvk2RHtMCR77XDfRAWtLXtLtL5IU0onzbbAzzZ+/f1Yi4ZSJNLnc4WPP//ZZp5vpA+FOffY/5/umQMYTeRXy36cvG3RpZAU2DcQ7Be9i15hYSO3nCgOjHktNAHQds5/Gl/2bpsPMrjNGLuGOA2mBtGIFntSFlpWqeSu9qK3xXCnSjPPssJC5IGldUb1o2MjE52ggji124cxJH3so53+tNb9h1C8JI5Sy1hVglZDx9jlBZfiTRkd/CIFkl6o0fwRcBNrgckHmsVe64yIzzYfkQ+cMnV39kN6sm5Sq8Sms0t7jabd9EVgf/b/m2sX5+CRvbXpFNXJZ3/ya4LRk/6deLjCZHhOUNhllTZGe1FN0affsMxZ3YcFGkk5LYKLs5ksbckwgjz+tRtDYz1i5p4AvViTwy9bN6hCfYHceeB/vSQ+XuFOtQMm7wfcciR0le+N6ga5FZdI0f9PeUYPzOF4pSOEoWP/b43YBo+Spy1dyz7PiPSSFdnY0ogsREsGGsaoPOEFXTnKtOyqnZzuVIRDr1O3uUIAdFFyK2CaQsvPKa8bKvbkRCGkKdfN2obCtCgyb7IpiBUmKXlhBjvWriMVKq8OSDsuv6dmci07Jjx83JNoBtyXv8H2Dhh+aw+YOfemg== X-Forefront-PRVS: 0267E514F9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(39450400003)(377454003)(377424004)(24454002)(65956001)(65806001)(305945005)(31696002)(7736002)(42186005)(66066001)(31686004)(2950100002)(38730400002)(86362001)(47776003)(23746002)(54906002)(6506006)(6512007)(6486002)(4326008)(93886004)(189998001)(6116002)(4001350100001)(83506001)(53936002)(3846002)(230700001)(50466002)(33646002)(65826007)(5660300001)(2906002)(6246003)(53546009)(229853002)(25786009)(36756003)(50986999)(54356999)(8676002)(76176999)(6666003)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR05MB760;H:linlap1.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BY2PR05MB760;23:+sfQBjX1N6sLcmSSENufihSmRVpW5TVh3kWwC/?= =?Windows-1252?Q?sH7nqMXwmxttBtYv6UD1nTVFPG/wnNv5RL3n/iOXIxl9MZMyo0U0ynzY?= =?Windows-1252?Q?ezx7y6I5I2+/lY/FP/LMNXnu6takSHEYSSzbBDFObSdliRPcbX0qWrm4?= =?Windows-1252?Q?hcPPI5LKI7BzMQjjbmBbQYF2H69YWhY2SMnw3I0pAqf9sbB75piAqOb2?= =?Windows-1252?Q?pTTnsW9608/kQPJMXmpe0SAai7Ipcrys/a3EHzvak2kfIZR0CiGK16M1?= =?Windows-1252?Q?HLHqAQT/44/MuBSRpXRW683Y+T6MALKXMv78EZ2bXe8rGYg7jarRQhWP?= =?Windows-1252?Q?BZMVObjSKZXmi3VyNe8wjQDWidVDhq9c4kom6fryDgWl1y+D63lxpkwe?= =?Windows-1252?Q?EUdHQjOFPxW22HLexaVy/rzoK5SqQ7DodnR4bjXyv7iGLZaLWS4bxfbG?= =?Windows-1252?Q?kzVGIp7dktm7X7AzDyTypNpyv0dDtAQvQdeAYl5ukIyMectx8ce1yBA1?= =?Windows-1252?Q?mGLu4fm0LzjexdwXMNy5HdQmI3it12J2hg2YORPWIzN35haF5EadUsNY?= =?Windows-1252?Q?9OpgayH5RQfKZhAxA9pFydYzaFbG7DUp/ukIjee4J15npBZimn3E2TKE?= =?Windows-1252?Q?ddT2v0Mz31A0AjujkOeuDo14JU1ONKQYEQPv/yzTL30ca86B0qqAFLNT?= =?Windows-1252?Q?5SEche5hjQG036K7kzOfhdsISl1ZlVrNyFYDRfyJUvEa/MWjslX010Es?= =?Windows-1252?Q?bsy1VdVWKtQ/5jns1zZfoPFMjOSmmNmx6vn2aS4USShMiIx7lmWLTnRY?= =?Windows-1252?Q?JnDXtS/yM9pCcNnAGg0zkZFVlfOqp/Ad5ImTOV1DymmGTeoFF+cjdIPl?= =?Windows-1252?Q?pjYLsIbrQi/x0qV/DULqENhW0ZklEpAZxD3BqqJlfbpm49hJDS0D5Qas?= =?Windows-1252?Q?Awd7QVeMh2zjzfeOkP//ya0MAjl0wf7tzrAfO6KSju1EPGo2lxmbi2Uk?= =?Windows-1252?Q?O6QhrC93DIMWwK2y+h9ZAgsMuZv9D/kTDEyM28se7KSWW2fpl1tJlTYc?= =?Windows-1252?Q?YQCmHeiTbAeldF5DYTdxQUXciacmAH6mTA3qUgHLYtZJhxXULAK3bi2S?= =?Windows-1252?Q?HK9kztvGYrST/ZGKG5jYDrWgRs5hcB2Iviz3zPuRJH4kupZcRAwHYLsc?= =?Windows-1252?Q?e+a+gkb1k9/ALChMdvy/dJbPfYdCKEN1/5cQmeFGt+gF5Rx38XfxAWTz?= =?Windows-1252?Q?/wg0eGJcXD1CjwN1M0hvOrpCztEusslTRzYltRCzCZppkPyVL436vCnh?= =?Windows-1252?Q?zbc/RJtBSVxtYK9oO25HSYrmuu8oN80BNNjWNBxxhqPI5eg6yfRkYS16?= =?Windows-1252?Q?otvi0VH1ThRcKeYCiEXk5mWeJEpllvcD8l5SrMdhxbDw5A5NLiiSI=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR05MB760;6:AayQrG63C9E14G1OFKZivTzYjm+fbtMYU5Jcv3CgdegA3XSW/NHJ0ZURbjNWOIg6iQj8FB1qQWgYnfgeuMAWUhVJ8SkGeFyQiL3oyiS+wI5JL9y1AsRMDeWgtFeqwWjJjNj2O+Jzv41RjAppwMIiVtdh6KZorQ699vuLlbXxry/a9BqzU8F3uF58i5jt1tNRepwBSvNVd16/phR4A6bNnaqXUyDS4u0aYAux7gCGP0+NFYfBKX0hbED6CHZg+/Ed9xzrAmvvN0p49g5Ve8IfpTn62EEWLLMcn1JGWs/9L9diiKUMKLFiUXrtrjFjLeXTeCp7g0E9M3Xo1xmqQ9iGnYjb+mzicu6l7bvxvdI2qqbpuq0WaOOFKKotdiuVai5imwP+5BbMu3QkdybQFQ/BrA==;5:jRA81l92zyCmQGoZqvKlyTgI2QaPja9opzJWiwrx3yO9fL8ApWWnUOA66YTMLODmqtt2CqpL6JK147SH4pdbCjlMN21sAlFmIjttIyp/L7W9g/IGAjIXvhS9sgLBfoMA12d01bGCj8xZrUog2b+zUQ==;24:LG3WejBKVSRaUVCJ9HwoFt3ksAQAJRTLS2T9idBhYQlbyTW56iDz7Cx45din6Bgn2xh4kpmOlGRB17VMUQ8DS8+lKydJw9mYV48unT+0ZoI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR05MB760;7:zPVmmhqHbVU6nBUb9ck2YDXLGh1vr/6wC4H+ku2u4Et25DlBepTF1GeF5jENhviMPX32DB9+qPIdIB6myKRPgi3I/yXNtAegiid4Ic5vxh+I+NklR3KceFUc3Vl7vTGuK3Sqw/YIXGzmBlPfrcQVSpkf1CKEvMcKBEQIQWPGwXs45WokPkQtfn/BMA5tLnnlU8WgDM1v9NIszYe7Cno6smdr3xoqaHZ4SImGqASwVA6wagmA0B+Nea8Y3ueeuN4srLPqC2G/TgI3/oyjtZJO27oprzlHrAgBircLUm0yr3RQX4qGczxganquLKA/Z2asFw41e0xOEZyhNMiDW9ZV7w==;20:MVHkrwhzKwg7FfTYKqIK1BXW6/o65N2/ar3Akob36/mfD0Gx7Emj7Nwbw8BsLmDktsUZP770BKxEVKDGjAHzNWh8gxfY+l+XzF1ort4N7Cis9xUxNeSIYblp0eCzl8lfTVnxjPgz4SL/Hqn60qsArpcwbeL5Ig7NzC4bnH1lD2U= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2017 09:49:15.6351 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB760 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1187 Lines: 42 On 04/04/2017 11:41 AM, Michal Hocko wrote: > On Thu 30-03-17 17:48:39, Andrey Ryabinin wrote: >> From: Andrey Ryabinin >> Subject: mm/vmalloc: allow to call vfree() in atomic context fix >> >> Don't spawn worker if we already purging. >> >> Signed-off-by: Andrey Ryabinin > I would rather put this into a separate patch. Ideally with some numners > as this is an optimization... Actually, this just mimics what the code was doing before, as it only invoked __purge_vmap_area_lazy() if the trylock succeeded. /Thomas > >> --- >> mm/vmalloc.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/mm/vmalloc.c b/mm/vmalloc.c >> index ea1b4ab..88168b8 100644 >> --- a/mm/vmalloc.c >> +++ b/mm/vmalloc.c >> @@ -737,7 +737,8 @@ static void free_vmap_area_noflush(struct vmap_area *va) >> /* After this point, we may free va at any time */ >> llist_add(&va->purge_list, &vmap_purge_list); >> >> - if (unlikely(nr_lazy > lazy_max_pages())) >> + if (unlikely(nr_lazy > lazy_max_pages()) && >> + !mutex_is_locked(&vmap_purge_lock)) >> schedule_work(&purge_vmap_work); >> } >> >> -- >> 2.10.2 >>