lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABPqkBSCckKtKUZ0P0FONtiygjmGYzgA1myE9aG+-RcQ9xnLsg@mail.gmail.com>
Date:	Wed, 2 Jul 2014 15:38:50 +0200
From:	Stephane Eranian <eranian@...gle.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	David Rientjes <rientjes@...gle.com>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [patch] x86, perf: avoid spamming kernel log for bts buffer failure

On Wed, Jul 2, 2014 at 3:31 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Wed, Jul 02, 2014 at 03:16:40PM +0200, Stephane Eranian wrote:
>> On Tue, Jul 1, 2014 at 11:34 AM, Peter Zijlstra <peterz@...radead.org> wrote:
>> > On Mon, Jun 30, 2014 at 04:04:08PM -0700, David Rientjes wrote:
>> >> It's unnecessary to excessively spam the kernel log anytime the BTS buffer
>> >> cannot be allocated, so make this allocation __GFP_NOWARN.
>> >>
>> >> The user probably will want to at least find some artifact that the
>> >> allocation has failed in the past, probably due to fragmentation because
>> >> of its large size, when it's not allocated at bootstrap.  Thus, add a
>> >> WARN_ONCE() so something is left behind for them to understand why perf
>> >> commnads that require PEBS is not working properly.
>> >
>> > Can you elaborate a bit under which conditions this triggered? Typically
>> > we should be doing fairly well allocating such buffers with GFP_KERNEL,
>> > that should allow things like compaction to run and create higher order
>> > pages.
>> >
>> I think this triggers when you have fragmented memory and you have
>> perf_events active and inactive (i.e., 0 users = no nmi watchdog) frequently.
>> Each first user invokes the reserve_ds() function to reserve DS, PEBS, BTS.
>
> Right, that'd suck. I suppose we could also change that to allocate the
> DS resources on first demand and never free them again.
>
Some may argue that if you never use perf_event again, you are wasting
(1 + 1 + 4) pages per CPU. That may not be okay on some systems.

But yes, it would avoid this problem and also take the penalty for the allocs
only once.


> So only allocate the PEBS buffer when we create the first PEBS event,
> and idem for the BTS muck.
>
>> The reason for BTS rather then PEBS is the size of the allocation.
>> PEBS allocates one page, i.e., less likely to get a failure than BTS
>> which allocates 4 pages, I think.
>
> Sure..
>
>> David and I discussed this. He can probably add more background
>> info, if needed.
>
> It would still be good to see why compaction etc is failing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ