X-Git-Url: http://git.cascardo.info/?p=cascardo%2Flinux.git;a=blobdiff_plain;f=mm%2Fksm.c;h=9ae6011a41f895d56942175814d1fe0158a591b7;hp=5048083b60f23bb2f0f78af969d6aa5df39aebfd;hb=1e90a13d0c3dc94512af1ccb2b6563e8297838fa;hpb=522533f338f38e15106d5f58901f38fe7bd6a7d8 diff --git a/mm/ksm.c b/mm/ksm.c index 5048083b60f2..9ae6011a41f8 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -299,7 +299,12 @@ static inline void free_rmap_item(struct rmap_item *rmap_item) static inline struct stable_node *alloc_stable_node(void) { - return kmem_cache_alloc(stable_node_cache, GFP_KERNEL); + /* + * The allocation can take too long with GFP_KERNEL when memory is under + * pressure, which may lead to hung task warnings. Adding __GFP_HIGH + * grants access to memory reserves, helping to avoid this problem. + */ + return kmem_cache_alloc(stable_node_cache, GFP_KERNEL | __GFP_HIGH); } static inline void free_stable_node(struct stable_node *stable_node)