Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mjeanson@efficios.com (Michael Jeanson)
Subject: [lttng-dev] [RFC v2] Add kmalloc failover to vmalloc
Date: Thu, 21 Sep 2017 16:30:22 -0400	[thread overview]
Message-ID: <72c66999-9d90-7101-199a-b0fc787d6f8e@efficios.com> (raw)
In-Reply-To: <779758199.15975.1506019933645.JavaMail.zimbra@efficios.com>

On 2017-09-21 14:52, Mathieu Desnoyers wrote:
> ----- On Sep 21, 2017, at 2:43 PM, Michael Jeanson mjeanson at efficios.com wrote:
> 
>> On 2017-09-21 14:39, Mathieu Desnoyers wrote:
>>> ----- On Sep 21, 2017, at 2:29 PM, Michael Jeanson mjeanson at efficios.com wrote:
>>>
>>>> This patch is based on the kvmalloc helpers introduced in kernel 4.12.
>>>>
>>>> It will gracefully failover memory allocations of more than one page to
>>>> vmalloc for systems under high memory pressure or fragmentation.
>>>>
>>>> I only used it in lttng-events.c as a POC, most allocations fit into a
>>>> single page so I'm not sure how useful this actually is.
>>>>
>>>> Thoughts?
>>>
>>> Just update the changelog to specify why we need this for struct lttng_session
>>> (~32kB), and you can submit it for good with a "Fix: " tag.
>>
>> I'm not sure it should be a fix, for this to be of any use all the other
>> allocations bigger than PAGE_SIZE should also use it. Otherwise, the
>> session allocation will succeed but the next sizeable allocation will
>> still fail.
> 
> What other allocations larger than PAGE_SIZE using kmalloc did you spot ?

This is not an exhaustive list :

lttng-context.c:
 - new_fields: 136 * n

lttng-context-perf-counters.c:
 - events: if you have more than 512 CPUs

lib/prio_heap/lttng_prio_heap.c:
 - new_ptrs


But mostly in the ringbuffer, thought I have no idea if a failover to
vmalloc is acceptable in this case.

> 
> Thanks,
> 
> Mathieu
> 
> 
>>
>>>
>>> Thanks,
>>>
>>> Mathieu
> 



  reply	other threads:[~2017-09-21 20:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 18:29 Michael Jeanson
2017-09-21 18:39 ` Mathieu Desnoyers
2017-09-21 18:43   ` Michael Jeanson
2017-09-21 18:52     ` Mathieu Desnoyers
2017-09-21 20:30       ` Michael Jeanson [this message]
2017-09-21 20:43         ` Mathieu Desnoyers

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=72c66999-9d90-7101-199a-b0fc787d6f8e@efficios.com \
    --to=mjeanson@efficios.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox