diff mbox series

[v2,1/1] s390/qeth: use memory reserves to back RX buffers

Message ID 20220210154417.120160-2-krzysztof.kozlowski@canonical.com
State New
Headers show
Series Hipersocket page allocation failure on Ubuntu 20.04 based SSC environments (LP: 1959529) | expand

Commit Message

Krzysztof Kozlowski Feb. 10, 2022, 3:44 p.m. UTC
From: Julian Wiedmann <jwi@linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1959529

Use dev_alloc_page() for backing the RX buffers with pages. This way we
pick up __GFP_MEMALLOC.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(backported from commit 714c9108851743bb718fbc1bfb81290f12a53854)
[krzysztof: based on backport from Frank Heimes; add __GFP_MEMALLOC flag
 in qeth_alloc_buffer_pool() because direct backport would be to
 intrusive and the flag seems to be the only important difference in
 this hunk; resolve context change in qeth_find_free_buffer_pool_entry()]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 drivers/s390/net/qeth_core_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index ec8c7a640d9e..018257f16dec 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -227,7 +227,7 @@  static int qeth_alloc_buffer_pool(struct qeth_card *card)
 			return -ENOMEM;
 		}
 		for (j = 0; j < QETH_MAX_BUFFER_ELEMENTS(card); ++j) {
-			ptr = (void *) __get_free_page(GFP_KERNEL);
+			ptr = (void *) __get_free_page(GFP_KERNEL|__GFP_MEMALLOC);
 			if (!ptr) {
 				while (j > 0)
 					free_page((unsigned long)
@@ -2612,7 +2612,7 @@  static struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry(
 			struct qeth_buffer_pool_entry, list);
 	for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i) {
 		if (page_count(virt_to_page(entry->elements[i])) > 1) {
-			page = alloc_page(GFP_ATOMIC);
+			page = dev_alloc_page();
 			if (!page) {
 				return NULL;
 			} else {