From: Andrew Morton <akpm@linux-foundation.org>
To: Markus Metzger <markus.t.metzger@intel.com>
Cc: andi-suse@firstfloor.org, hpa@zytor.com,
linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@linutronix.de,
markus.t.metzger@intel.com, markus.t.metzger@gmail.com,
suresh.b.siddha@intel.com, roland@redhat.com,
mtk.manpages@gmail.com, eranian@googlemail.com,
juan.villacis@intel.com
Subject: Re: [patch 1/1] x86, ptrace: PEBS support
Date: Tue, 15 Apr 2008 17:35:34 -0700 [thread overview]
Message-ID: <20080415173534.b746f8da.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080408110158.A9336@sedona.ch.intel.com>
On Tue, 8 Apr 2008 11:01:58 +0200
Markus Metzger <markus.t.metzger@intel.com> wrote:
> +static inline void *ds_allocate_buffer(size_t size, unsigned int *pages)
> {
> - (*(unsigned long *)(base + ds_cfg.bts_interrupt_threshold.offset)) = value;
> + unsigned long rlim, vm, pgsz;
> + void *buffer;
> +
> + pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT;
> +
> + rlim = current->signal->rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT;
> + vm = current->mm->total_vm + pgsz;
> + if (rlim < vm)
> + return 0;
> +
> + rlim = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT;
> + vm = current->mm->locked_vm + pgsz;
> + if (rlim < vm)
> + return 0;
Should we skip the RLIMIT_MEMLOCK check if capable(CAP_IPC_LOCK)?
It's a fairly large patch.
next prev parent reply other threads:[~2008-04-16 0:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-08 9:01 [patch 1/1] x86, ptrace: PEBS support Markus Metzger
2008-04-16 0:35 ` Andrew Morton [this message]
2008-04-16 7:15 ` Andi Kleen
2008-04-16 8:51 ` stephane eranian
2008-04-16 14:47 ` Ingo Molnar
2008-04-16 22:59 ` stephane eranian
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=20080415173534.b746f8da.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andi-suse@firstfloor.org \
--cc=eranian@googlemail.com \
--cc=hpa@zytor.com \
--cc=juan.villacis@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.t.metzger@gmail.com \
--cc=markus.t.metzger@intel.com \
--cc=mingo@elte.hu \
--cc=mtk.manpages@gmail.com \
--cc=roland@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/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