From: Linus Torvalds <torvalds@osdl.org>
To: David Howells <dhowells@redhat.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: fork pagesize patch
Date: Tue, 16 Nov 2004 09:11:03 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0411160909370.2222@ppc970.osdl.org> (raw)
In-Reply-To: <26707.1100624330@redhat.com>
On Tue, 16 Nov 2004, David Howells wrote:
> >
> > I think it _is_ unreasonable. It's like doing
> >
> > if (a)
> > x /= a;
>
> Doing it with variables is not exactly the same. The compiler has been told to
> optimise arithmetic on constants, and as such it has to represent a div-by-0
> result, which obviously it can't.
But you snipped the part where the above source code _does_ end up being
done on constants - in macro expansion and in inline functions. So the
compiler really _can_ have a constant zero in the divide, and it really
_can_ come from perfectly normal code.
In fact, maybe code like the kernel had.
> > Anyway, to make it not warn, why not change it to
> >
> > max_threads = mempages / (8*THREAD_SIZE/PAGE_SIZE);
> >
> > instead, and be done with it?
>
> And drop the conditional entirely? I can go along with that.
Right. It looks like the obvious thing to do, and is really what the code
_tried_ to do in the first place.
Linus
prev parent reply other threads:[~2004-11-16 17:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-16 15:38 David Howells
2004-11-16 16:02 ` Linus Torvalds
2004-11-16 16:11 ` David Howells
2004-11-16 16:40 ` Linus Torvalds
2004-11-16 16:58 ` David Howells
2004-11-16 17:11 ` Linus Torvalds [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=Pine.LNX.4.58.0411160909370.2222@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=akpm@osdl.org \
--cc=dhowells@redhat.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
all inboxes | Powered by JetHome®