Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764402AbcLTS15 (ORCPT ); Tue, 20 Dec 2016 13:27:57 -0500 Received: from mail-ve1eur01on0118.outbound.protection.outlook.com ([104.47.1.118]:15680 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753917AbcLTS1w (ORCPT ); Tue, 20 Dec 2016 13:27:52 -0500 X-Greylist: delayed 7142 seconds by postgrey-1.27 at vger.kernel.org; Tue, 20 Dec 2016 13:27:51 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; From: Roman Kagan To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , "K. Y. Srinivasan" , Vitaly Kuznetsov CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , Haiyang Zhang , , , , "Denis V . Lunev" , Roman Kagan Subject: [PATCH 05/15] hyperv: GFP_ATOMIC -> GFP_KERNEL Date: Tue, 20 Dec 2016 18:55:52 +0300 Message-ID: <20161220155602.6298-6-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161220155602.6298-1-rkagan@virtuozzo.com> References: <20161220155602.6298-1-rkagan@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: AM4PR01CA0030.eurprd01.prod.exchangelabs.com (10.164.74.168) To VI1PR0802MB2478.eurprd08.prod.outlook.com (10.175.26.21) X-MS-Office365-Filtering-Correlation-Id: 5a8ab070-3812-448f-4038-08d428f0ccea X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0802MB2478; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0802MB2478;3:ic9jVodUGtDKk+tqxAGX/bWIyhHqclmgFfFt/85CqSr0I+WVh6sOeB8t5qNK9qyo6hZhGDpCPTNrOD47rpnAG3NG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Ujh4ViFKIxcekoSOIlAaDBH9/Js5K7Uv6BwfrboL0EPNHQSoeJ6LYOq6SJNmJ/CPNJSNvES5Mlod/syuYG+kFeivzb+Y6WYukFcyF5Ala2iOfHQiBV++O95ftNC5bSYNve43I7m1sA2yt3lbuDKKsAyU3CglDAaNsvVklH8caVvgieC4cm0Dd370Q60eWBkr9hlfnRjC2l5fA3zypVTOA2gBuCPWirI87tCaOg9+4ueMZZJ0jg==;20:QEuhvszcJSnr/cKbFMJ6Hc/SVnGYiu2DbFIMWWAGJUv7D+jSUtu8t+EyZNoBpn0BySQbhXwIhk7nszT4XQfaWhCr8525nxnd1FvGpi5gY2sepCXRZVy0y4GjDc1Pyssv2DahHYdZ3oFLgG31UIecZQxBCntOpnI0OLR1aXzCeEv0DWTSOrSeVPve0XlyHRu9Mj/oPjnMns9V6DDCx/D9Mxum3P5Bsuqi70Nrtcyop9WMW1mDJ1e441rupVyxhApM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123558021)(20161123562025)(6072148);SRVR:VI1PR0802MB2478;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0802MB2478; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0802MB2478;4:aWivYDv/gsGVcTV/TaYzidiDHXxeZjISTGD+Qz1X4Sbn/IlUYkfIbkdar7TP1cmSlawRaS0inK8CO9Ib9jfGz7+w2/1Scw9yZygmj0foga20PdKYRT/8F4LELcZYvogEyNu2QGica9AojZl+lKn5tNxsLqzogal9gThJP3bk0HlaDEOztL1WfHvAMkOWJJBSch7wW2l6G5g0uVgJzj/PoNsIXWRchmVdPlbIP/VXcia1fII4WnZryf1DPnm+v9qfoR9qhh3bJdU/mSY1qgFITBr5ByFeO7UUKgeziYSxRl2xAxcgoMfAOg/93zqBdXBeUMjo6S0r9QS/5racfCEsX1beZgZ0DCINuhCtHw7csSxV+3s0q1qvb5XC7aKtW4zoc3AIjR1nNCiK7B69O22hStMFBe22zTnI9YJ++1tqXL9By4dvfYOiwsWIXeaKvsGzmK+iMHGlK0gTFZJYicUg0WAflI7U0DW8TCg+RHs7dExKMYvTbqU4W6rImxc13VdwoEzo/aWfPZ5L3yEvu3qqmZU90oBkAT/j23n4mEWsF9XGmWY+eu/hyJ0J7v2gzDe/RAgdzwvNf7hN83mvSka1fj6SkOQ6ZEquMQICViU/6zc= X-Forefront-PRVS: 0162ACCC24 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(6666003)(97736004)(189998001)(101416001)(5001770100001)(4001430100002)(5003940100001)(36756003)(81166006)(47776003)(50986999)(66066001)(1511001)(2950100002)(50466002)(76176999)(5660300001)(81156014)(2906002)(8666005)(305945005)(69596002)(48376002)(7736002)(92566002)(7416002)(106356001)(53416004)(25786008)(6116002)(105586002)(6486002)(2421001)(6506006)(1076002)(3846002)(575784001)(86362001)(4326007)(68736007)(8676002)(50226002)(42186005)(107886002)(2561002)(38730400001)(6512006)(33646002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0802MB2478;H:rkaganb.sw.ru;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0802MB2478;23:hobm/18nudG+vO36YPmBwWj7AQplGwqVeD+vTva?= =?us-ascii?Q?2RC7nNRe6Dy6hKE0lwagO7rl5uvrVCFsY51Z5GU1lwV+Fs/sY6l8C+xt1Xkn?= =?us-ascii?Q?dFBDfzLue3ksnzhzKl473x8HWlvSK0FrdGpLZfsjj5NDFDMdV/RYQSleMg87?= =?us-ascii?Q?vFsCt5Anl2c+UiOQd9LeaOXxuv6fxfRVscptAkGqwQj2/48aa5gYkqSp59N7?= =?us-ascii?Q?TfR9aEZ0J9WU0mrBemcDi7eC639MP0xbGBTUha9DcNS01JS1W1VySff+VKcB?= =?us-ascii?Q?XtvhkL967K7HVZQhi8CcHont4FaX0SRku+2Aq9odem7AecdaCq2rOhne9DTl?= =?us-ascii?Q?NMCqrLR/ig/hmMcZxagfoEw32bSM6e4IOpvObH5cgkphfp01dhkL5oAWHI0q?= =?us-ascii?Q?k/BoCL5UduEwEI6xlAZS3Zlixta+MjAye1jzHgEbihZEtj1w1glNHQ88ANZF?= =?us-ascii?Q?k8dqwFcOKi53TS0fuBpPrOID2FawBosaqnGkkDJCwVLTHnWXXn53Lk+ITEQ5?= =?us-ascii?Q?IkMO5/zYTin35BzdeHF0fcV5aqLzBjXvT56qU6/21gxwU2njr9A45XXX4+S8?= =?us-ascii?Q?LWZ91pqRCFqoqgIQNMJQwiWhQb4I/g2CT9vTjgvx3knKX7HfBhZ501LfYbz7?= =?us-ascii?Q?I5N02xt2t1bVD6BopQ//gi1Sd38upmG0NteZXQut8R3+mPsU2qpaITIML4F+?= =?us-ascii?Q?j6X6HP72z5aeop/JkYfmQkBfvF0V1RFnZaekt1+nG9uQ/3zbof11uoxlJpky?= =?us-ascii?Q?oMYM8nmHwKxvWLgcXUdLYRR7m+h/404K8Oi5UeVuzb8LgCF98ruTSFlNFq+/?= =?us-ascii?Q?em1crk55eiAyxsTePP5lKlmtIP+wb4e395BZXrnvf4CigYaahzWwKs/19Jib?= =?us-ascii?Q?k7u5Vlsx+grUgOdBnWhwl/wB3C4p0Cb9ci68WS7mOhwKRMT775OWzQHUi2Rj?= =?us-ascii?Q?kvvPpeey+tRL1RCgQHWiVck5QOoK1iGtNrsHXFWDUyLJTfgH9Yet6YiqS3Lq?= =?us-ascii?Q?jLJLlkaxDPxa2B3FX1ohyFesBEBmDHQ8nds7basBkukLQRlhbXM9TK7wbRlh?= =?us-ascii?Q?NyKOFXT7qL6xonqQbX0XPkfwUuZG2Aq224y6SlNo/9A2nk/AeHOTYKgSvrSP?= =?us-ascii?Q?owwZ/A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zZM2olIpi7SlDIdz9dbTNCVAwXLB2fDKojqDd2qyCGvRFTkKay6csknC1RMLa5ursHB+tlam7uG52MFsyIe06p8iOz1n3nr/ReTbYgJLcp1hsC4hHI6D5LBrmd5bSvhaNiJLe4Pxs6Np/XqXLFrlgOaPvxp22a05Kf69FGNLG+2Q/5hK3MprhYeLJ2l+c/hVS6OEFkRCYL33q9LddclWS9Sqfm4dq8zIMZ6ZRDVJlqcI8kJcYl0R90UZ+hqI3L4TAP6boTucA3t1yUeBpNXunw7m6g6f68BgBo9+czDLjGdioQjn6qom6ayBvQ2ZFU7MtGrSDIa2D3QEiwrfuXcPmMsPZMqfhNcJlyDiiHnDjL6BaU28ZVetQiJAzrdHLpCDcfd5rTQ56zEdD6aYypiQN/uwKilA2x4J84uX6sYTgOikNf3ycfmjSPM/F7l4fOxdP3j6kzxPSA==;20:ySyT2OsnqNopTSZbEwhatlsKY36jtPpHSLMIAdGLAJRdgsTTxtWiYKiv4MhMM0VYlgbOnvDtxPyEHSdBxoNvDGDK9u0TlPQw179jWh3hdmH0NmZUqAZ9Jo7k79nuUhh2pFk75/kVhdY/NFvZF3lcmZK09mjFVX10Ko/qSXN/gPc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2016 15:56:45.1049 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2478 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3102 Lines: 91 There's no need in GFP_ATOMIC when initializing the driver state. While at this, also rely on free_page() to take null argument. Signed-off-by: Roman Kagan --- drivers/hv/hv.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index a7256ec..6bbc0b09 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -393,28 +393,28 @@ int hv_synic_alloc(void) int cpu; hv_context.hv_numa_map = kzalloc(sizeof(struct cpumask) * nr_node_ids, - GFP_ATOMIC); + GFP_KERNEL); if (hv_context.hv_numa_map == NULL) { pr_err("Unable to allocate NUMA map\n"); goto err; } for_each_online_cpu(cpu) { - hv_context.event_dpc[cpu] = kmalloc(size, GFP_ATOMIC); + hv_context.event_dpc[cpu] = kmalloc(size, GFP_KERNEL); if (hv_context.event_dpc[cpu] == NULL) { pr_err("Unable to allocate event dpc\n"); goto err; } tasklet_init(hv_context.event_dpc[cpu], vmbus_on_event, cpu); - hv_context.msg_dpc[cpu] = kmalloc(size, GFP_ATOMIC); + hv_context.msg_dpc[cpu] = kmalloc(size, GFP_KERNEL); if (hv_context.msg_dpc[cpu] == NULL) { pr_err("Unable to allocate event dpc\n"); goto err; } tasklet_init(hv_context.msg_dpc[cpu], vmbus_on_msg_dpc, cpu); - hv_context.clk_evt[cpu] = kzalloc(ced_size, GFP_ATOMIC); + hv_context.clk_evt[cpu] = kzalloc(ced_size, GFP_KERNEL); if (hv_context.clk_evt[cpu] == NULL) { pr_err("Unable to allocate clock event device\n"); goto err; @@ -423,7 +423,7 @@ int hv_synic_alloc(void) hv_init_clockevent_device(hv_context.clk_evt[cpu], cpu); hv_context.synic_message_page[cpu] = - (void *)get_zeroed_page(GFP_ATOMIC); + (void *)get_zeroed_page(GFP_KERNEL); if (hv_context.synic_message_page[cpu] == NULL) { pr_err("Unable to allocate SYNIC message page\n"); @@ -431,7 +431,7 @@ int hv_synic_alloc(void) } hv_context.synic_event_page[cpu] = - (void *)get_zeroed_page(GFP_ATOMIC); + (void *)get_zeroed_page(GFP_KERNEL); if (hv_context.synic_event_page[cpu] == NULL) { pr_err("Unable to allocate SYNIC event page\n"); @@ -439,7 +439,7 @@ int hv_synic_alloc(void) } hv_context.post_msg_page[cpu] = - (void *)get_zeroed_page(GFP_ATOMIC); + (void *)get_zeroed_page(GFP_KERNEL); if (hv_context.post_msg_page[cpu] == NULL) { pr_err("Unable to allocate post msg page\n"); @@ -457,12 +457,9 @@ static void hv_synic_free_cpu(int cpu) kfree(hv_context.event_dpc[cpu]); kfree(hv_context.msg_dpc[cpu]); kfree(hv_context.clk_evt[cpu]); - if (hv_context.synic_event_page[cpu]) - free_page((unsigned long)hv_context.synic_event_page[cpu]); - if (hv_context.synic_message_page[cpu]) - free_page((unsigned long)hv_context.synic_message_page[cpu]); - if (hv_context.post_msg_page[cpu]) - free_page((unsigned long)hv_context.post_msg_page[cpu]); + free_page((unsigned long)hv_context.synic_event_page[cpu]); + free_page((unsigned long)hv_context.synic_message_page[cpu]); + free_page((unsigned long)hv_context.post_msg_page[cpu]); } void hv_synic_free(void) -- 2.9.3