mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Variable PTE_FILE_MAX_BITS
Date: Tue, 8 Apr 2003 22:55:14 -0700	[thread overview]
Message-ID: <20030408225514.478469e0.akpm@digeo.com> (raw)
In-Reply-To: <20030409011653.A9103@devserv.devel.redhat.com>

Pete Zaitcev <zaitcev@redhat.com> wrote:
>
> Andrew,
> 
> would you be so kind to take this and forward to Linus?
> I think this segment of the code is your brainchild.

y'know, as I was writing that code I thought "no architecture could be dumb
enough to make PTE_FILE_MAX_BITS variable".

> On sparc

Ah.  That architecture.

> 
> --- linux-2.5.66-bk11/mm/fremap.c	2003-04-05 13:26:24.000000000 -0800
> +++ linux-2.5.66-bk11-sparc/mm/fremap.c	2003-04-05 13:28:22.000000000 -0800
> @@ -136,10 +136,10 @@
>  		return err;
>  
>  	/* Can we represent this offset inside this architecture's pte's? */
> -#if PTE_FILE_MAX_BITS < BITS_PER_LONG
> -	if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS))
> -		return err;
> -#endif
> +	/* This needs to be evaluated at runtime on some platforms */
> +	if (PTE_FILE_MAX_BITS < BITS_PER_LONG)
> +		if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS))
> +			return err;
>  

The reason I didn't do this in the first place is that if PTE_FILE_MAX_BITS
is 32 (as it is for ia32 PAE), the compiler generates a warning about the
(1<<32).  I guess it generates a bug, too.

Ho hum.  I shall make it "1ULL".

  reply	other threads:[~2003-04-09  5:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09  5:16 Pete Zaitcev
2003-04-09  5:55 ` Andrew Morton [this message]
2003-04-09  6:19   ` Pete Zaitcev

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=20030408225514.478469e0.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.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

all inboxes | Powered by JetHome®