From: Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
arnd-r2nGTMty4D4@public.gmane.org,
"H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>,
ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Subject: Re: [patch 143/166] preadv/pwritev: Add preadv and pwritev system calls.
Date: Thu, 2 Apr 2009 18:43:08 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.0904021839390.15441@localhost.localdomain> (raw)
In-Reply-To: <200904022359.n32NxNYu022834-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
On Thu, 2 Apr 2009, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org wrote:
>
> glibc entriely and use a syscall prototype which works without
> arch-specific wrappers inside the kernel: The offset argument is
> explicitly split into two 32bit values.
Grr. That may make sense on 32-bit architectures, but makes no sense
what-so-ever on 64-bit ones.
Why not just say that it's two "unsigned long" arguments, and split it by
"sizeof unsigned long". And then, on 64-bit architectures, the high bits
can be ignored. You can even get gcc to optimize it all away by doing
something like
#define HALF_LONG (BITS_IN_LONG / 2)
offset = (((loff_t)high << HALF_LONG) << HALF_LONG) | low;
and then gcc should automaticaly notice that shifting up that way is just
a fancy way of saying "0", and ignore the high bits.
How married are people to this crazy 2x "32 bits" model?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kraxel@redhat.com, arnd@arndb.de,
"H. Peter Anvin" <hpa@zytor.com>,
linux-api@vger.kernel.org, linux-arch@vger.kernel.org,
Ingo Molnar <mingo@elte.hu>,
ralf@linux-mips.org, tglx@linutronix.de,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [patch 143/166] preadv/pwritev: Add preadv and pwritev system calls.
Date: Thu, 2 Apr 2009 18:43:08 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.0904021839390.15441@localhost.localdomain> (raw)
Message-ID: <20090403014308.wCDDzE9tCmTRsOPIGXUvkd7ZpXBqtn35-o28J1tid_s@z> (raw)
In-Reply-To: <200904022359.n32NxNYu022834@imap1.linux-foundation.org>
On Thu, 2 Apr 2009, akpm@linux-foundation.org wrote:
>
> glibc entriely and use a syscall prototype which works without
> arch-specific wrappers inside the kernel: The offset argument is
> explicitly split into two 32bit values.
Grr. That may make sense on 32-bit architectures, but makes no sense
what-so-ever on 64-bit ones.
Why not just say that it's two "unsigned long" arguments, and split it by
"sizeof unsigned long". And then, on 64-bit architectures, the high bits
can be ignored. You can even get gcc to optimize it all away by doing
something like
#define HALF_LONG (BITS_IN_LONG / 2)
offset = (((loff_t)high << HALF_LONG) << HALF_LONG) | low;
and then gcc should automaticaly notice that shifting up that way is just
a fancy way of saying "0", and ignore the high bits.
How married are people to this crazy 2x "32 bits" model?
Linus
next prev parent reply other threads:[~2009-04-03 1:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-02 23:59 [patch 143/166] preadv/pwritev: Add preadv and pwritev system calls akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
2009-04-02 23:59 ` akpm
[not found] ` <200904022359.n32NxNYu022834-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2009-04-03 1:43 ` Linus Torvalds [this message]
2009-04-03 1:43 ` Linus Torvalds
2009-04-03 8:35 ` Gerd Hoffmann
2009-04-03 9:25 ` Gerd Hoffmann
[not found] ` <49D5D609.7030400-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-04-03 11:53 ` Gerd Hoffmann
2009-04-03 11:53 ` Gerd Hoffmann
2009-04-03 15:03 ` Linus Torvalds
2009-04-03 19:57 ` Gerd Hoffmann
[not found] ` <49D66A22.7090909-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-04-03 20:08 ` Linus Torvalds
2009-04-03 20:08 ` Linus Torvalds
2009-04-04 17:38 ` Andrew Morton
2009-04-04 17:51 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.0904021839390.15441-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-03 16:57 ` H. Peter Anvin
2009-04-03 16:57 ` H. Peter Anvin
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=alpine.LFD.2.00.0904021839390.15441@localhost.localdomain \
--to=torvalds-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
--cc=kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-X9Un+BFzKDI@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.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