Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1225128
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: memcontrol: fix order calculation in try_charge() |
| Date | 2015-09-15 16:00 +0200 |
| Message-ID | <q8YW5-6Co-11@gated-at.bofh.it> (permalink) |
| References | <q8XdD-4lR-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue 15-09-15 14:05:57, Jerome Marchand wrote: > Since commit <6539cc05386> (mm: memcontrol: fold mem_cgroup_do_charge()), > the order to pass to mem_cgroup_oom() is calculated by passing the number > of pages to get_order() instead of the expected size in bytes. AFAICT, > it only affects the value displayed in the oom warning message. > This patch fix this. We haven't noticed that just because the OOM is enabled only for page faults of order-0 (single page) and get_order work just fine. Thanks for noticing this. If we ever start triggering OOM on different orders this would be broken. > Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Acked-by: Michal Hocko <mhocko@suse.com> Btw. a quick git grep shows that at least gart_iommu_init is using number of pages as well. I haven't checked it does that intentionally, though. Thanks! > --- > mm/memcontrol.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 1742a2d..91bf094 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2032,7 +2032,8 @@ retry: > > mem_cgroup_events(mem_over_limit, MEMCG_OOM, 1); > > - mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(nr_pages)); > + mem_cgroup_oom(mem_over_limit, gfp_mask, > + get_order(nr_pages * PAGE_SIZE)); > nomem: > if (!(gfp_mask & __GFP_NOFAIL)) > return -ENOMEM; > -- > 1.9.3 -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: memcontrol: fix order calculation in try_charge() "Jerome Marchand" <jmarchan@redhat.com> - 2015-09-15 14:10 +0200
Re: [PATCH] mm: memcontrol: fix order calculation in try_charge() Michal Hocko <mhocko@kernel.org> - 2015-09-15 16:00 +0200
Re: [PATCH] mm: memcontrol: fix order calculation in try_charge() Michal Hocko <mhocko@kernel.org> - 2015-09-17 15:10 +0200
Re: [PATCH] mm: memcontrol: fix order calculation in try_charge() Johannes Weiner <hannes@cmpxchg.org> - 2015-09-18 09:50 +0200
csiph-web