Re: [PATCH] Optimize is_power_of_2().

2007-06-15 Thread David M. Lloyd
On Fri, 15 Jun 2007 14:54:20 -0500 "David M. Lloyd" <[EMAIL PROTECTED]> wrote: > On Fri, 15 Jun 2007 21:47:50 +0200 (CEST) > Jan Engelhardt <[EMAIL PROTECTED]> wrote: > > > On Jun 15 2007 18:56, Vegard Nossum wrote: > > > bool is_power_of_2(unsigned

Re: [PATCH] Optimize is_power_of_2().

2007-06-15 Thread David M. Lloyd
On Fri, 15 Jun 2007 21:47:50 +0200 (CEST) Jan Engelhardt <[EMAIL PROTECTED]> wrote: > On Jun 15 2007 18:56, Vegard Nossum wrote: > > bool is_power_of_2(unsigned long n) > > { > >-return (n != 0 && ((n & (n - 1)) == 0)); > >+return n * !(n & (n - 1)); > > } > > There is a third way which

Re: [PATCH] Optimize is_power_of_2().

2007-06-15 Thread David M. Lloyd
On Fri, 15 Jun 2007 21:47:50 +0200 (CEST) Jan Engelhardt [EMAIL PROTECTED] wrote: On Jun 15 2007 18:56, Vegard Nossum wrote: bool is_power_of_2(unsigned long n) { -return (n != 0 ((n (n - 1)) == 0)); +return n * !(n (n - 1)); } There is a third way which uses neither * nor

Re: [PATCH] Optimize is_power_of_2().

2007-06-15 Thread David M. Lloyd
On Fri, 15 Jun 2007 14:54:20 -0500 David M. Lloyd [EMAIL PROTECTED] wrote: On Fri, 15 Jun 2007 21:47:50 +0200 (CEST) Jan Engelhardt [EMAIL PROTECTED] wrote: On Jun 15 2007 18:56, Vegard Nossum wrote: bool is_power_of_2(unsigned long n) { - return (n != 0 ((n (n - 1)) == 0

Re: Syslets, Threadlets, generic AIO support, v6

2007-05-30 Thread David M. Lloyd
On Wed, 30 May 2007 14:27:52 -0700 (PDT) Linus Torvalds <[EMAIL PROTECTED]> wrote: > Well, don't think of it as a special case at all: think of bit 30 as > a "the user asked for a non-linear fd". If the sole point is to protect an fd from being closed or operated on outside of a certain context,

Re: Syslets, Threadlets, generic AIO support, v6

2007-05-30 Thread David M. Lloyd
On Wed, 30 May 2007 14:27:52 -0700 (PDT) Linus Torvalds [EMAIL PROTECTED] wrote: Well, don't think of it as a special case at all: think of bit 30 as a the user asked for a non-linear fd. If the sole point is to protect an fd from being closed or operated on outside of a certain context, why

Re: Detecting process death for anycast named process monitoring

2007-05-03 Thread David M. Lloyd
On Wed, 2007-05-02 at 16:30 -0600, Chris Friesen wrote: > Glen Turner wrote: > > > The question is, how can a process with no relationship to another > > process detect that process unexpectedly dying? If named goes > > away to a better place, we want to shut down the interface > > which causes

Re: Detecting process death for anycast named process monitoring

2007-05-03 Thread David M. Lloyd
On Wed, 2007-05-02 at 16:30 -0600, Chris Friesen wrote: Glen Turner wrote: The question is, how can a process with no relationship to another process detect that process unexpectedly dying? If named goes away to a better place, we want to shut down the interface which causes Quagga to

Re: sys_write() racy for multi-threaded append?

2007-03-13 Thread David M. Lloyd
On Tue, 2007-03-13 at 02:24 +, Alan Cox wrote: > > purports to handle short writes but has never been exercised is > > arguably worse than code that simply bombs on short write. So if I > > can't shim in an induce-short-writes-randomly-on-purpose mechanism > > during development, I don't want

Re: sys_write() racy for multi-threaded append?

2007-03-13 Thread David M. Lloyd
On Tue, 2007-03-13 at 02:24 +, Alan Cox wrote: purports to handle short writes but has never been exercised is arguably worse than code that simply bombs on short write. So if I can't shim in an induce-short-writes-randomly-on-purpose mechanism during development, I don't want short

Re: [patch 2/5] signalfd v2 - signalfd core ...

2007-03-08 Thread David M. Lloyd
On Wed, 2007-03-07 at 17:21 -0800, Davide Libenzi wrote: > int signalfd_dequeue(int fd, siginfo_t *info, long timeo); > > The "fd" parameter must ba a signalfd file descriptor. The "info" parameter > is a pointer to the siginfo that will receive the dequeued signal, and > "timeo" is a timeout in

Re: [patch 2/5] signalfd v2 - signalfd core ...

2007-03-08 Thread David M. Lloyd
On Wed, 2007-03-07 at 17:21 -0800, Davide Libenzi wrote: int signalfd_dequeue(int fd, siginfo_t *info, long timeo); The fd parameter must ba a signalfd file descriptor. The info parameter is a pointer to the siginfo that will receive the dequeued signal, and timeo is a timeout in

Re: [PATCH] remove availability for PAGE_SIZE and friends (i386)

2007-03-06 Thread David M. Lloyd
On Tue, 2007-03-06 at 08:31 -0800, David Brown wrote: > +#define __KERNEL__ That's a #define, not an #ifdef... - DML - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] remove availability for PAGE_SIZE and friends (i386)

2007-03-06 Thread David M. Lloyd
On Tue, 2007-03-06 at 08:31 -0800, David Brown wrote: +#define __KERNEL__ That's a #define, not an #ifdef... - DML - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [take35 0/10] kevent: Generic event handling mechanism.

2007-02-05 Thread David M. Lloyd
On Thu, 2007-02-01 at 13:12 +0300, Evgeniy Polyakov wrote: > Generic event handling mechanism. The patch applied cleanly to 2.6.20 final, but I got a build error: CC kernel/kevent/kevent.o CC kernel/kevent/kevent_user.o CC kernel/kevent/kevent_timer.o CC

Re: [take35 0/10] kevent: Generic event handling mechanism.

2007-02-05 Thread David M. Lloyd
On Thu, 2007-02-01 at 13:12 +0300, Evgeniy Polyakov wrote: Generic event handling mechanism. The patch applied cleanly to 2.6.20 final, but I got a build error: CC kernel/kevent/kevent.o CC kernel/kevent/kevent_user.o CC kernel/kevent/kevent_timer.o CC