public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Hicks <mort@wildopensource.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] perthread_pages_alloc cleanup
Date: Mon, 28 Feb 2005 10:52:48 -0500	[thread overview]
Message-ID: <20050228155248.GR26705@localhost> (raw)


Hi Andrew,

This is just a cleanup - no functional changes.  Gets a bunch of code
outside an if by returning NULL earlier.

-- 
Martin Hicks                Wild Open Source Inc.
mort@wildopensource.com     613-266-2296


Signed-Off-By: Martin Hicks <mort@wildopensource.com>


Index: linux-2.6.10/mm/page_alloc.c
===================================================================
--- linux-2.6.10.orig/mm/page_alloc.c	2005-02-25 08:02:33.000000000 -0800
+++ linux-2.6.10/mm/page_alloc.c	2005-02-28 07:08:01.000000000 -0800
@@ -710,6 +710,7 @@
 perthread_pages_alloc(void)
 {
 	struct list_head *perthread_pages;
+	struct page *page;
 
 	/*
 	 * try to allocate pages from the per-thread private_pages pool. No
@@ -717,18 +718,16 @@
 	 * itself, and not by interrupts or other threads.
 	 */
 	perthread_pages = get_per_thread_pages();
-	if (!in_interrupt() && !list_empty(perthread_pages)) {
-		struct page *page;
-
-		page = list_entry(perthread_pages->next, struct page, lru);
-		list_del(&page->lru);
-		current->private_pages_count--;
-		/*
-		 * per-thread page is already initialized, just return it.
-		 */
-		return page;
-	} else
+	if (in_interrupt() || list_empty(perthread_pages))
 		return NULL;
+
+	page = list_entry(perthread_pages->next, struct page, lru);
+	list_del(&page->lru);
+	current->private_pages_count--;
+	/*
+	 * per-thread page is already initialized, just return it.
+	 */
+	return page;
 }
 
 /*

             reply	other threads:[~2005-02-28 15:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-28 15:52 Martin Hicks [this message]
2005-02-28 21:35 ` [PATCH] perthread_pages_alloc cleanup Christoph Hellwig
2005-02-28 21:44   ` Martin Hicks

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=20050228155248.GR26705@localhost \
    --to=mort@wildopensource.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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