public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: hugh@veritas.com, andrea@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.6.5-aa1 arch updates
Date: Sun, 4 Apr 2004 15:10:58 -0700	[thread overview]
Message-ID: <20040404151058.5ddc703e.akpm@osdl.org> (raw)
In-Reply-To: <20040404145126.03156a15.akpm@osdl.org>

Andrew Morton <akpm@osdl.org> wrote:
>
> Hugh Dickins <hugh@veritas.com> wrote:
>  >
>  > I notice that's a __GFP_REPEAT allocation, but even those fail when
>  >  OOM-killed - I find its alias __GFP_NOFAIL very misleading.
> 
>  #define __GFP_REPEAT	0x400	/* Retry the allocation.  Might fail */
>  #define __GFP_NOFAIL	0x800	/* Retry for ever.  Cannot fail */
> 
>  __GFP_REPEAT is mainly for higher-order allocations which would otherwise
>  have given up too early.

It all comes back to me now.  The reason there is a __GFP_REPEAT in the
pte_alloc_one() implementations is that lots of architectures used to do
stuff like this:

static inline pte_t *
pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
{
	int count = 0;
	pte_t *pte;

	do {
		pte = (pte_t *)__get_free_page(GFP_KERNEL);
		if (pte)
			clear_page(pte);
		else {
			current->state = TASK_UNINTERRUPTIBLE;
			schedule_timeout(HZ);
		}
	} while (!pte && (count++ < 10));

	return pte;
}

That was all removed and the __GFP_REPEAT flag was added instead, as a "try
really hard" hint to the page allocator.


      reply	other threads:[~2004-04-04 22:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-04 13:48 [PATCH] 2.6.5-aa1 arch updates Hugh Dickins
2004-04-04 15:49 ` Andrea Arcangeli
2004-04-04 22:30   ` Paul Mackerras
2004-04-04 23:09     ` Andrea Arcangeli
2004-04-04 21:51 ` Andrew Morton
2004-04-04 22:10   ` Andrew Morton [this message]

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=20040404151058.5ddc703e.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=hugh@veritas.com \
    --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