The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: mel@csn.ul.ie, akpm@osdl.org, torvalds@osdl.org,
	linux-kernel@vger.kernel.org, linux-mm@vger.kernel.org
Subject: Re: Major mke2fs slowdown (reproducable, bisected)
Date: Tue, 13 Nov 2007 17:25:09 +0100	[thread overview]
Message-ID: <p736406yuxm.fsf@bingen.suse.de> (raw)
In-Reply-To: <20071112182526.GC11244@martell.zuzino.mipt.ru> (Alexey Dobriyan's message of "Mon\, 12 Nov 2007 21\:25\:26 +0300")

Alexey Dobriyan <adobriyan@gmail.com> writes:
>  
> +/* Return the page with the lowest PFN in the list */
> +static struct page *min_page(struct list_head *list)
> +{
> +	unsigned long min_pfn = -1UL;
> +	struct page *min_page = NULL, *page;;
> +
> +	list_for_each_entry(page, list, lru) {
> +		unsigned long pfn = page_to_pfn(page);
> +		if (pfn < min_pfn) {
> +			min_pfn = pfn;
> +			min_page = page;
> +		}
> +	}
> +
> +	return min_page;
> +}
> +
>  /* Remove an element from the buddy allocator from the fallback list */
>  static struct page *__rmqueue_fallback(struct zone *zone, int order,
>  						int start_migratetype)
> @@ -795,8 +812,11 @@ retry:
>  			if (list_empty(&area->free_list[migratetype]))
>  				continue;
>  
> +			/* Bias kernel allocations towards low pfns */
>  			page = list_entry(area->free_list[migratetype].next,
>  					struct page, lru);
> +			if (unlikely(start_migratetype != MIGRATE_MOVABLE))
> +				page = min_page(&area->free_list[migratetype]);

Do I misread this, or does it really turn the O(1) buddy allocation into
a "search whole free list" algorithm?  Even as fallback that looks like
a quite extreme thing to do.

-Andi

  parent reply	other threads:[~2007-11-13 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 18:25 Major mke2fs slowdown (reproducable, bisected) Alexey Dobriyan
2007-11-12 18:39 ` Linus Torvalds
2007-11-12 21:34   ` Alexey Dobriyan
2007-11-12 22:15     ` Linus Torvalds
2007-11-13 16:25 ` Andi Kleen [this message]
2007-11-14 11:25   ` Mel Gorman
2007-11-13 16:54 ` Mel Gorman
2007-11-14 11:17   ` Mel Gorman

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=p736406yuxm.fsf@bingen.suse.de \
    --to=andi@firstfloor.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=torvalds@osdl.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