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] [day] [month] [year] [list]
Message-ID: <20140630175828.GC1236@krava.redhat.com>
Date:	Mon, 30 Jun 2014 19:58:28 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	David Ahern <dsahern@...il.com>
Cc:	Jiri Olsa <jolsa@...nel.org>, linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Jean Pihet <jean.pihet@...aro.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH 07/18] perf tools: Limit ordered events queue size

On Fri, Jun 27, 2014 at 05:11:15PM -0600, David Ahern wrote:
> On 6/18/14, 8:58 AM, Jiri Olsa wrote:
> >@@ -520,7 +522,7 @@ static void queue_event(struct ordered_events_queue *q, struct ordered_event *ne
> >  static struct ordered_event *alloc_event(struct ordered_events_queue *q)
> >  {
> >  	struct list_head *cache = &q->cache;
> >-	struct ordered_event *new;
> >+	struct ordered_event *new = NULL;
> >
> >  	if (!list_empty(cache)) {
> >  		new = list_entry(cache->next, struct ordered_event, list);
> >@@ -529,10 +531,14 @@ static struct ordered_event *alloc_event(struct ordered_events_queue *q)
> >  		new = q->buffer + q->buffer_idx;
> >  		if (++q->buffer_idx == MAX_SAMPLE_BUFFER)
> >  			q->buffer = NULL;
> >-	} else {
> >-		q->buffer = malloc(MAX_SAMPLE_BUFFER * sizeof(*new));
> >+	} else if (q->cur_alloc_size < q->max_alloc_size) {
> >+		size_t size = MAX_SAMPLE_BUFFER * sizeof(*new);
> >+
> >+		q->buffer = malloc(size);
> >  		if (!q->buffer)
> >  			return NULL;
> >+
> >+		q->cur_alloc_size += size;
> >  		list_add(&q->buffer->list, &q->to_free);
> >
> 
> When is cur_alloc_size decremented?

never, it get's incremented untiul we reach the limit,
then it stays and the cache is used for new events..
and it's all released at the end

jirka
--
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