Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1422839
| From | Balbir Singh <bsingharora@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact |
| Date | 2016-06-15 11:50 +0200 |
| Message-ID | <rKfCp-Pv-19@gated-at.bofh.it> (permalink) |
| References | <rKfsK-Lj-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jun 15, 2016 at 7:34 PM, Ganesh Mahendran <opensource.ganesh@gmail.com> wrote: > In the callee try_to_compact_pages(), the (order == 0) is checked, > so remove check in __alloc_pages_direct_compact. > > Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com> > --- > v2: > remove the check in __alloc_pages_direct_compact - Anshuman Khandual > --- > mm/page_alloc.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index b9ea618..2f5a82a 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3173,9 +3173,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, > struct page *page; > int contended_compaction; > > - if (!order) > - return NULL; > - > current->flags |= PF_MEMALLOC; > *compact_result = try_to_compact_pages(gfp_mask, order, alloc_flags, ac, > mode, &contended_compaction); What is the benefit of this. Is an if check more expensive than calling the function and returning from it? I don't feel strongly about such changes, but its good to audit the overall code for reading and performance. Balbir Singh
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-06-15 11:40 +0200
Re: [PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact Balbir Singh <bsingharora@gmail.com> - 2016-06-15 11:50 +0200
Re: [PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact Vlastimil Babka <vbabka@suse.cz> - 2016-06-15 12:00 +0200
Re: [PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact Michal Nazarewicz <mina86@mina86.com> - 2016-06-15 18:50 +0200
csiph-web