From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: open-iscsi@googlegroups.com,
Christoph Hellwig <hch@infradead.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
linux-fsdevel@vger.kernel.org, ext2-devel@lists.sourceforge.net,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: allowed pages in the block later, was Re: [Ext2-devel] [PATCH] ext3: avoid sending down non-refcounted pages
Date: Thu, 8 Dec 2005 21:20:33 +0200 [thread overview]
Message-ID: <84144f020512081120u428ebd6eud0566a7d57a7726a@mail.gmail.com> (raw)
In-Reply-To: <439879ED.5050706@cs.wisc.edu>
Hi,
On 12/8/05, Mike Christie <michaelc@cs.wisc.edu> wrote:
> Or there is not a way to do kmalloc(GFP_BLK) that gives us the right
> type of memory is there?
The slab allocator uses page->lru for special purposes. See
page_{set|get}_{cache|slab} in mm/slab.c. They are used by kfree(),
ksize() and slab debugging code to lookup the cache and slab an void
pointer belongs to.
But, if you just need put_page and get_page, couldn't you do something
like the following?
Pekka
Index: 2.6/mm/swap.c
===================================================================
--- 2.6.orig/mm/swap.c
+++ 2.6/mm/swap.c
@@ -36,6 +36,9 @@ int page_cluster;
void put_page(struct page *page)
{
+ if (unlikely(PageSlab(page)))
+ return;
+
if (unlikely(PageCompound(page))) {
page = (struct page *)page_private(page);
if (put_page_testzero(page)) {
Index: 2.6/include/linux/mm.h
===================================================================
--- 2.6.orig/include/linux/mm.h
+++ 2.6/include/linux/mm.h
@@ -322,6 +322,9 @@ static inline int page_count(struct page
static inline void get_page(struct page *page)
{
+ if (unlikely(PageSlab(page)))
+ return;
+
if (unlikely(PageCompound(page)))
page = (struct page *)page_private(page);
atomic_inc(&page->_count);
next prev parent reply other threads:[~2005-12-08 19:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-08 9:09 [PATCH] ext3: avoid sending down non-refcounted pages FUJITA Tomonori
2005-12-08 10:18 ` Andreas Dilger
2005-12-08 12:39 ` [Ext2-devel] " FUJITA Tomonori
2005-12-08 13:42 ` allowed pages in the block later, was " Christoph Hellwig
2005-12-08 13:58 ` Pekka Enberg
2005-12-12 17:27 ` allowed pages in the block later, was " Christoph Hellwig
2005-12-08 18:18 ` allowed pages in the block later, was Re: [Ext2-devel] " Mike Christie
2005-12-08 18:22 ` Mike Christie
2005-12-08 19:20 ` Pekka Enberg [this message]
2005-12-11 0:47 ` Andrew Morton
2005-12-11 8:44 ` allowed pages in the block later, was " Arjan van de Ven
2005-12-12 17:25 ` allowed pages in the block later, was Re: [Ext2-devel] " Christoph Hellwig
2005-12-12 20:12 ` Andrew Morton
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=84144f020512081120u428ebd6eud0566a7d57a7726a@mail.gmail.com \
--to=penberg@cs.helsinki.fi \
--cc=ext2-devel@lists.sourceforge.net \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=michaelc@cs.wisc.edu \
--cc=open-iscsi@googlegroups.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;
as well as URLs for NNTP newsgroup(s).