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: <alpine.DEB.1.10.0809301350410.6224@gandalf.stny.rr.com>
Date:	Tue, 30 Sep 2008 13:56:36 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Peter Zijlstra <peterz@...radead.org>
cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jonathan Corbet <corbet@....net>,
	Mathieu Desnoyers <compudj@...stal.dyndns.org>,
	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	prasad@...ux.vnet.ibm.com, "Frank Ch. Eigler" <fche@...hat.com>,
	David Wilder <dwilder@...ibm.com>, hch@....de,
	Martin Bligh <mbligh@...gle.com>,
	Christoph Hellwig <hch@...radead.org>,
	Masami Hiramatsu <mhiramat@...hat.com>,
	Steven Rostedt <srostedt@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH v10 Golden] Unified trace buffer


On Tue, 30 Sep 2008, Peter Zijlstra wrote:
> 
> The problem with storing the page link information inside the page is
> that it doesnt transfer to another address space, so if you do indeed
> mmap these pages, then the link information is bogus.
> 
> Of course, in such a situation you could ignore these headers, but
> somehow that doesn't sound too apealing.


No that's not what I'm proposing. I'm proposing to allocate a page_header 
structure for every page we alloc, and make a link list of them.
In other words:


struct ring_buffer_per_cpu {
	[...]
	struct list_head pages;
	[...]
};

struct buffer_page {
	[...];
	void *page;
	struct list_head list;
	[...];
};

In ring_buffer_allocate_cpu:

	struct buffer_page *bpage;
	struct unsigned long addr;

	[...]

	for every page() {
		bpage = kzalloc(sizeof(*bpage), GFP_KERNEL);
		addr = get_free_page();
		bpage->page = (void *)addr;
		list_add(&bpage->list, &cpu_buffer->pages);
	}


Obviously need to add the error checking, but you get the idea. Here I do 
not need to change any of the later logic, because we are still dealing 
with the buffer_page. I only need to update way to index the page which is 
already encapsulated in its own function.

-- Steve


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