[Devel] [PATCH RHEL9 COMMIT] net/drivers/slip: disable high-order allocations warnings in slip driver

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jan 12 18:36:42 MSK 2022


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.38
------>
commit 6c3e8e85a77ae1657d358c753795cffd5ee22d14
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Wed Jan 12 18:36:42 2022 +0300

    net/drivers/slip: disable high-order allocations warnings in slip driver
    
    slip driver can trigger high-order allocations in sl_change_mtu(),
    sl_alloc_bufs() and slhc_init().
    
    https://jira.sw.ru/browse/PSBM-125232
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    
    (cherry picked from vz7 commit 42c0ed59307de123abaf795d4485ca87c83716cb)
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    
    Feature: mm: avoid high order allocations in all subsystems
---
 drivers/net/slip/slhc.c |  4 ++--
 drivers/net/slip/slip.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c
index ba93bab948e0..e630a362ee96 100644
--- a/drivers/net/slip/slhc.c
+++ b/drivers/net/slip/slhc.c
@@ -104,7 +104,7 @@ slhc_init(int rslots, int tslots)
 
 	if (rslots > 0) {
 		size_t rsize = rslots * sizeof(struct cstate);
-		comp->rstate = kzalloc(rsize, GFP_KERNEL);
+		comp->rstate = kzalloc(rsize, GFP_KERNEL | __GFP_ORDER_NOWARN);
 		if (! comp->rstate)
 			goto out_free;
 		comp->rslot_limit = rslots - 1;
@@ -112,7 +112,7 @@ slhc_init(int rslots, int tslots)
 
 	if (tslots > 0) {
 		size_t tsize = tslots * sizeof(struct cstate);
-		comp->tstate = kzalloc(tsize, GFP_KERNEL);
+		comp->tstate = kzalloc(tsize, GFP_KERNEL | __GFP_ORDER_NOWARN);
 		if (! comp->tstate)
 			goto out_free2;
 		comp->tslot_limit = tslots - 1;
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index dc84cb844319..e104e4f71787 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -153,14 +153,14 @@ static int sl_alloc_bufs(struct slip *sl, int mtu)
 	 */
 	if (len < 576 * 2)
 		len = 576 * 2;
-	rbuff = kmalloc(len + 4, GFP_KERNEL);
+	rbuff = kmalloc(len + 4, GFP_KERNEL | __GFP_ORDER_NOWARN);
 	if (rbuff == NULL)
 		goto err_exit;
-	xbuff = kmalloc(len + 4, GFP_KERNEL);
+	xbuff = kmalloc(len + 4, GFP_KERNEL | __GFP_ORDER_NOWARN);
 	if (xbuff == NULL)
 		goto err_exit;
 #ifdef SL_INCLUDE_CSLIP
-	cbuff = kmalloc(len + 4, GFP_KERNEL);
+	cbuff = kmalloc(len + 4, GFP_KERNEL | __GFP_ORDER_NOWARN);
 	if (cbuff == NULL)
 		goto err_exit;
 	slcomp = slhc_init(16, 16);
@@ -235,10 +235,10 @@ static int sl_realloc_bufs(struct slip *sl, int mtu)
 	if (len < 576 * 2)
 		len = 576 * 2;
 
-	xbuff = kmalloc(len + 4, GFP_ATOMIC);
-	rbuff = kmalloc(len + 4, GFP_ATOMIC);
+	xbuff = kmalloc(len + 4, GFP_ATOMIC | __GFP_ORDER_NOWARN);
+	rbuff = kmalloc(len + 4, GFP_ATOMIC | __GFP_ORDER_NOWARN);
 #ifdef SL_INCLUDE_CSLIP
-	cbuff = kmalloc(len + 4, GFP_ATOMIC);
+	cbuff = kmalloc(len + 4, GFP_ATOMIC | __GFP_ORDER_NOWARN);
 #endif
 
 


More information about the Devel mailing list