forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commit8510e69
mm/page_alloc: fix memalloc_nocma_{save/restore} APIs
Currently, memalloc_nocma_{save/restore} API that prevents CMA areain page allocation is implemented by using current_gfp_context(). However,there are two problems of this implementation.First, this doesn't work for allocation fastpath. In the fastpath,original gfp_mask is used since current_gfp_context() is introduced inorder to control reclaim and it is on slowpath. So, CMA area can beallocated through the allocation fastpath even ifmemalloc_nocma_{save/restore} APIs are used. Currently, there is justone user for these APIs and it has a fallback method to prevent actualproblem.Second, clearing __GFP_MOVABLE in current_gfp_context() has a side effectto exclude the memory on the ZONE_MOVABLE for allocation target.To fix these problems, this patch changes the implementation to excludeCMA area in page allocation. Main point of this change is using thealloc_flags. alloc_flags is mainly used to control allocation so it fitsfor excluding CMA area in allocation.Fixes:d7fefcc (mm/cma: add PF flag to force non cma alloc)Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Reviewed-by: Vlastimil Babka <vbabka@suse.cz>Cc: Christoph Hellwig <hch@infradead.org>Cc: Roman Gushchin <guro@fb.com>Cc: Mike Kravetz <mike.kravetz@oracle.com>Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>Cc: Michal Hocko <mhocko@suse.com>Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>Link:http://lkml.kernel.org/r/1595468942-29687-1-git-send-email-iamjoonsoo.kim@lge.comSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent182f3d7 commit8510e69
2 files changed
+22
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
183 | | - | |
| 181 | + | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
| |||
189 | 187 | | |
190 | 188 | | |
191 | 189 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2785 | 2785 | | |
2786 | 2786 | | |
2787 | 2787 | | |
2788 | | - | |
| 2788 | + | |
2789 | 2789 | | |
2790 | 2790 | | |
2791 | 2791 | | |
| |||
2796 | 2796 | | |
2797 | 2797 | | |
2798 | 2798 | | |
2799 | | - | |
| 2799 | + | |
2800 | 2800 | | |
2801 | 2801 | | |
2802 | 2802 | | |
| |||
3687 | 3687 | | |
3688 | 3688 | | |
3689 | 3689 | | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
3690 | 3704 | | |
3691 | 3705 | | |
3692 | 3706 | | |
| |||
4333 | 4347 | | |
4334 | 4348 | | |
4335 | 4349 | | |
4336 | | - | |
4337 | | - | |
4338 | | - | |
4339 | | - | |
| 4350 | + | |
| 4351 | + | |
4340 | 4352 | | |
4341 | 4353 | | |
4342 | 4354 | | |
| |||
4637 | 4649 | | |
4638 | 4650 | | |
4639 | 4651 | | |
4640 | | - | |
| 4652 | + | |
4641 | 4653 | | |
4642 | 4654 | | |
4643 | 4655 | | |
| |||
4714 | 4726 | | |
4715 | 4727 | | |
4716 | 4728 | | |
4717 | | - | |
| 4729 | + | |
4718 | 4730 | | |
4719 | 4731 | | |
4720 | 4732 | | |
| |||
4806 | 4818 | | |
4807 | 4819 | | |
4808 | 4820 | | |
4809 | | - | |
4810 | | - | |
| 4821 | + | |
4811 | 4822 | | |
4812 | 4823 | | |
4813 | 4824 | | |
| |||
0 commit comments
Comments
(0)