Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1614963

Re: [PATCH -v2 1/2] mm, swap: Use kvzalloc to allocate some swap data structure

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH -v2 1/2] mm, swap: Use kvzalloc to allocate some swap data structure
Date 2017-04-03 10:20 +0200
Message-ID <ts5nr-4l0-1@gated-at.bofh.it> (permalink)
References (5 earlier) <torFU-6sZ-19@gated-at.bofh.it> <torZg-6BK-29@gated-at.bofh.it> <toxV0-2ms-3@gated-at.bofh.it> <tqLh8-GX-27@gated-at.bofh.it> <trj97-6e8-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat 01-04-17 12:47:56, Huang, Ying wrote:
> Hi, Michal,
> 
> Michal Hocko <mhocko@kernel.org> writes:
> 
> > On Fri 24-03-17 06:56:10, Dave Hansen wrote:
> >> On 03/24/2017 12:33 AM, John Hubbard wrote:
> >> > There might be some additional information you are using to come up with
> >> > that conclusion, that is not obvious to me. Any thoughts there? These
> >> > calls use the same underlying page allocator (and I thought that both
> >> > were subject to the same constraints on defragmentation, as a result of
> >> > that). So I am not seeing any way that kmalloc could possibly be a
> >> > less-fragmenting call than vmalloc.
> >> 
> >> You guys are having quite a discussion over a very small point.
> >> 
> >> But, Ying is right.
> >> 
> >> Let's say we have a two-page data structure.  vmalloc() takes two
> >> effectively random order-0 pages, probably from two different 2M pages
> >> and pins them.  That "kills" two 2M pages.
> >> 
> >> kmalloc(), allocating two *contiguous* pages, is very unlikely to cross
> >> a 2M boundary (it theoretically could).  That means it will only "kill"
> >> the possibility of a single 2M page.  More 2M pages == less fragmentation.
> >
> > Yes I agree with this. And the patch is no brainer. kvmalloc makes sure
> > to not try too hard on the kmalloc side so I really didn't get the
> > objection about direct compaction and reclaim which initially started
> > this discussion. Besides that the swapon path usually happens early
> > during the boot where we should have those larger blocks available.
> 
> Could I add your Acked-by for this patch?

Yes but please add the reasoning pointed out by Dave. As the patch
doesn't give any numbers and it would be fairly hard to add some without
artificial workloads we should at least document our current thinking
so that we can revisit it later.

Thanks!

Acked-by: Michal Hocko <mhocko@suse.com>

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH -v2 1/2] mm, swap: Use kvzalloc to allocate some swap  data structure Michal Hocko <mhocko@kernel.org> - 2017-03-30 18:40 +0200
  Re: [PATCH -v2 1/2] mm, swap: Use kvzalloc to allocate some swap data structure "Huang\, Ying" <ying.huang@intel.com> - 2017-04-01 06:50 +0200
    Re: [PATCH -v2 1/2] mm, swap: Use kvzalloc to allocate some swap  data structure Michal Hocko <mhocko@kernel.org> - 2017-04-03 10:20 +0200
      Re: [PATCH -v2 1/2] mm, swap: Use kvzalloc to allocate some swap data structure "Huang\, Ying" <ying.huang@intel.com> - 2017-04-05 02:50 +0200

csiph-web