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


Groups > linux.kernel > #1588584

Re: [PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers
Date 2017-02-27 11:20 +0100
Message-ID <tfqzo-491-15@gated-at.bofh.it> (permalink)
References <teVce-7pj-3@gated-at.bofh.it> <teYWt-1zx-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat 25-02-17 20:38:29, Tahsin Erdogan wrote:
> When pcpu_alloc() is called with gfp != GFP_KERNEL, the likelihood of
> a failure is higher than GFP_KERNEL case. This is mainly because
> pcpu_alloc() relies on previously allocated reserves and does not make
> an effort to add memory to its pools for non-GFP_KERNEL case.

Who is going to use a different mask?
 
> This issue is somewhat mitigated by kicking off a background work when
> a memory allocation failure occurs. But this doesn't really help the
> original victim of allocation failure.
> 
> This problem affects blkg_lookup_create() callers on machines with a
> lot of cpus.
> 
> This patch reduces failure cases by trying to expand the memory pools.
> It passes along gfp flag so it is safe to allocate memory this way.
> 
> To make this work, a gfp flag aware vmalloc_gfp() function is added.
> Also, locking around vmap_area_lock has been updated to save/restore
> irq flags. This was needed to avoid a lockdep problem between
> request_queue->queue_lock and vmap_area_lock.

We already have __vmalloc_gfp, why this cannot be used? Also note that
vmalloc dosn't really support arbitrary gfp flags. One have to be really
careful because there are some internal allocations which are hardcoded
GFP_KERNEL. Also this patch doesn't really add any new callers so it is
hard to tell whether what you do actually makes sense and is correct.
-- 
Michal Hocko
SUSE Labs

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


Thread

[PATCH 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-25 22:10 +0100
  Re: [PATCH 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers kbuild test robot <lkp@intel.com> - 2017-02-26 01:00 +0100
  Re: [PATCH 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers kbuild test robot <lkp@intel.com> - 2017-02-26 01:50 +0100
    [PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-26 05:50 +0100
      Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Michal Hocko <mhocko@kernel.org> - 2017-02-27 11:20 +0100
        Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-27 14:10 +0100
          Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Michal Hocko <mhocko@kernel.org> - 2017-02-27 16:30 +0100
            Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Michal Hocko <mhocko@kernel.org> - 2017-02-27 18:10 +0100
              Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Michal Hocko <mhocko@kernel.org> - 2017-02-27 18:40 +0100
                Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-27 20:40 +0100
                Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Michal Hocko <mhocko@kernel.org> - 2017-02-27 20:50 +0100
            Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-27 18:10 +0100
          Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-27 21:30 +0100
            Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tejun Heo <tj@kernel.org> - 2017-02-27 21:40 +0100
              Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-27 21:50 +0100
                Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tahsin Erdogan <tahsin@google.com> - 2017-02-27 22:20 +0100
                Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tejun Heo <tj@kernel.org> - 2017-02-27 22:40 +0100
                Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tejun Heo <tj@kernel.org> - 2017-02-27 23:40 +0100
          Re: [PATCH v2 3/3] percpu: improve allocation success rate for  non-GFP_KERNEL callers Tejun Heo <tj@kernel.org> - 2017-02-27 23:40 +0100

csiph-web