[Devel] [PATCH RHEL7 COMMIT] disable high-order allocations warnings in slip driver

Vasily Averin vvs at virtuozzo.com
Wed Mar 3 13:34:35 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.15.2.vz7.173.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.15.2.vz7.173.2
------>
commit 42c0ed59307de123abaf795d4485ca87c83716cb
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Wed Mar 3 13:34:35 2021 +0300

    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>
---
 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 1252d9c..e3d564b 100644
--- a/drivers/net/slip/slhc.c
+++ b/drivers/net/slip/slhc.c
@@ -100,7 +100,7 @@ slhc_init(int rslots, int tslots)
 
 	if ( rslots > 0  &&  rslots < 256 ) {
 		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;
@@ -108,7 +108,7 @@ slhc_init(int rslots, int tslots)
 
 	if ( tslots > 0  &&  tslots < 256 ) {
 		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 748e68f..b004abb 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