Skip to contentSkip to conversation

alloc_page nofs avoid deadlock

PATCH In review chenguanyou 2 participants 2 messages Jun 3, 2021 FUSE filesystem core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alloc_page nofs avoid deadlock

ABA deadlock

PID: 17172 TASK: ffffffc0c162c000 CPU: 6 COMMAND: "Thread-21"

PID: 9652 TASK: ffffffc0c9ce0000 CPU: 4 COMMAND: "kworker/u16:8"

---
 fs/fuse/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/dev.c +1 -1
index c0fee830a34e..d36125ff0405 100644
@@ -721,7 +721,7 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
 			if (cs->nr_segs >= cs->pipe->max_usage)
 				return -EIO;
 
-			page = alloc_page(GFP_HIGHUSER);
+			page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
 			if (!page)
 				return -ENOMEM;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · chenguanyou

ABA deadlock

PID: 17172 TASK: ffffffc0c162c000 CPU: 6 COMMAND: "Thread-21"

PID: 9652 TASK: ffffffc0c9ce0000 CPU: 4 COMMAND: "kworker/u16:8"

Please be much more specific about the underlying issue and what the actual lock dependency during the reclaim is. The above is essentially void of any relevant information.

Quoted 20 lines
---
 fs/fuse/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/dev.c +1 -1
index c0fee830a34e..d36125ff0405 100644
@@ -721,7 +721,7 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
 			if (cs->nr_segs >= cs->pipe->max_usage)
 				return -EIO;
 
-			page = alloc_page(GFP_HIGHUSER);
+			page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
 			if (!page)
 				return -ENOMEM;
 
Signature · 1 line
2.17.1
Signature · 2 lines
Michal Hocko
SUSE Labs