All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tahsin Erdogan <tahsin@google.com>
To: Tejun Heo <tj@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>,
	Christoph Lameter <cl@linux.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Roman Pen <r.peniaev@gmail.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	zijun_hu <zijun_hu@htc.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers
Date: Mon, 27 Feb 2017 12:37:59 -0800	[thread overview]
Message-ID: <CAAeU0aMnz-nsXGy44mwBfzwfFJtVWNRQiAE0UAonBQA3iDJBqg@mail.gmail.com> (raw)
In-Reply-To: <20170227202906.GF8707@htj.duckdns.org>

On Mon, Feb 27, 2017 at 12:29 PM, Tejun Heo <tj@kernel.org> wrote:
> Hello,
>
> On Mon, Feb 27, 2017 at 12:27:08PM -0800, Tahsin Erdogan wrote:
>> A better example is the call path below:
>>
>> pcpu_alloc+0x68f/0x710
>> __alloc_percpu_gfp+0xd/0x10
>> __percpu_counter_init+0x55/0xc0
>> cfq_pd_alloc+0x3b2/0x4e0
>> blkg_alloc+0x187/0x230
>> blkg_create+0x489/0x670
>> blkg_lookup_create+0x9a/0x230
>> blkg_conf_prep+0x1fb/0x240
>> __cfqg_set_weight_device.isra.105+0x5c/0x180
>> cfq_set_weight_on_dfl+0x69/0xc0
>> cgroup_file_write+0x39/0x1c0
>> kernfs_fop_write+0x13f/0x1d0
>> __vfs_write+0x23/0x120
>> vfs_write+0xc2/0x1f0
>> SyS_write+0x44/0xb0
>> entry_SYSCALL_64_fastpath+0x18/0xad
>>
>> A failure in this call path gives grief to tools which are trying to
>> configure io
>> weights. We see occasional failures happen here shortly after reboots even
>> when system is not under any memory pressure. Machines with a lot of cpus
>> are obviously more vulnerable.
>
> Ah, absolutely, that's a stupid failure but we should be able to fix
> that by making the blkg functions take gfp mask and allocate
> accordingly, right?  It'll probably take preallocation tricks because
> of locking but should be doable.

My initial goal was to allow calls to vmalloc(), but I now see the
challenges in that
approach.

Doing preallocations would probably work but not sure if that can be
done without
complicating code too much. Could you describe what you have in mind?

WARNING: multiple messages have this Message-ID (diff)
From: Tahsin Erdogan <tahsin@google.com>
To: Tejun Heo <tj@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>,
	Christoph Lameter <cl@linux.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Roman Pen <r.peniaev@gmail.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	zijun_hu <zijun_hu@htc.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers
Date: Mon, 27 Feb 2017 12:37:59 -0800	[thread overview]
Message-ID: <CAAeU0aMnz-nsXGy44mwBfzwfFJtVWNRQiAE0UAonBQA3iDJBqg@mail.gmail.com> (raw)
In-Reply-To: <20170227202906.GF8707@htj.duckdns.org>

On Mon, Feb 27, 2017 at 12:29 PM, Tejun Heo <tj@kernel.org> wrote:
> Hello,
>
> On Mon, Feb 27, 2017 at 12:27:08PM -0800, Tahsin Erdogan wrote:
>> A better example is the call path below:
>>
>> pcpu_alloc+0x68f/0x710
>> __alloc_percpu_gfp+0xd/0x10
>> __percpu_counter_init+0x55/0xc0
>> cfq_pd_alloc+0x3b2/0x4e0
>> blkg_alloc+0x187/0x230
>> blkg_create+0x489/0x670
>> blkg_lookup_create+0x9a/0x230
>> blkg_conf_prep+0x1fb/0x240
>> __cfqg_set_weight_device.isra.105+0x5c/0x180
>> cfq_set_weight_on_dfl+0x69/0xc0
>> cgroup_file_write+0x39/0x1c0
>> kernfs_fop_write+0x13f/0x1d0
>> __vfs_write+0x23/0x120
>> vfs_write+0xc2/0x1f0
>> SyS_write+0x44/0xb0
>> entry_SYSCALL_64_fastpath+0x18/0xad
>>
>> A failure in this call path gives grief to tools which are trying to
>> configure io
>> weights. We see occasional failures happen here shortly after reboots even
>> when system is not under any memory pressure. Machines with a lot of cpus
>> are obviously more vulnerable.
>
> Ah, absolutely, that's a stupid failure but we should be able to fix
> that by making the blkg functions take gfp mask and allocate
> accordingly, right?  It'll probably take preallocation tricks because
> of locking but should be doable.

My initial goal was to allow calls to vmalloc(), but I now see the
challenges in that
approach.

Doing preallocations would probably work but not sure if that can be
done without
complicating code too much. Could you describe what you have in mind?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-02-27 20:39 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 21:00 [PATCH 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers Tahsin Erdogan
2017-02-25 21:00 ` Tahsin Erdogan
2017-02-25 23:54 ` kbuild test robot
2017-02-25 23:54   ` kbuild test robot
2017-02-26  0:48 ` kbuild test robot
2017-02-26  0:48   ` kbuild test robot
2017-02-26  4:38   ` [PATCH v2 " Tahsin Erdogan
2017-02-26  4:38     ` Tahsin Erdogan
2017-02-27  9:52     ` Michal Hocko
2017-02-27  9:52       ` Michal Hocko
2017-02-27 13:00       ` Tahsin Erdogan
2017-02-27 13:00         ` Tahsin Erdogan
2017-02-27 15:25         ` Michal Hocko
2017-02-27 15:25           ` Michal Hocko
2017-02-27 17:01           ` Tahsin Erdogan
2017-02-27 17:01             ` Tahsin Erdogan
2017-02-27 17:07             ` Michal Hocko
2017-02-27 17:07               ` Michal Hocko
2017-02-27 17:14               ` Michal Hocko
2017-02-27 17:14                 ` Michal Hocko
2017-02-27 19:32                 ` Tahsin Erdogan
2017-02-27 19:32                   ` Tahsin Erdogan
2017-02-27 19:47                   ` Michal Hocko
2017-02-27 19:47                     ` Michal Hocko
2017-02-27 19:51         ` Tejun Heo
2017-02-27 19:51           ` Tejun Heo
2017-02-27 20:27           ` Tahsin Erdogan
2017-02-27 20:27             ` Tahsin Erdogan
2017-02-27 20:29             ` Tejun Heo
2017-02-27 20:29               ` Tejun Heo
2017-02-27 20:37               ` Tahsin Erdogan [this message]
2017-02-27 20:37                 ` Tahsin Erdogan
2017-02-27 20:45                 ` Tejun Heo
2017-02-27 20:45                   ` Tejun Heo
2017-02-27 21:12                   ` Tahsin Erdogan
2017-02-27 21:12                     ` Tahsin Erdogan
2017-02-27 21:28                     ` Tejun Heo
2017-02-27 21:28                       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeU0aMnz-nsXGy44mwBfzwfFJtVWNRQiAE0UAonBQA3iDJBqg@mail.gmail.com \
    --to=tahsin@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=r.peniaev@gmail.com \
    --cc=rientjes@google.com \
    --cc=tj@kernel.org \
    --cc=zijun_hu@htc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.