Re: Question on atomic_inc/dec

From: sankar (san_madhav_at_hotmail.com)
Date: 10/15/03

  • Next message: Richard B. Johnson: "Re: ld-Script needed OR (predicted) Architecture of Kernel 3.0 ;-)"
    To: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>, "Tim Hockin" <thockin@hockin.org>
    Date:	Wed, 15 Oct 2003 10:28:34 -0700
    
    

    Hi,
     any solution to the original problem???
    (atomic_inc() defintion not there in redhat 9.0 asm/atomic.h)
    ----- Original Message -----
    From: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
    To: "Tim Hockin" <thockin@hockin.org>
    Cc: "sankar" <san_madhav@hotmail.com>; <linux-kernel@vger.kernel.org>
    Sent: Tuesday, October 14, 2003 3:29 PM
    Subject: RE: Question on atomic_inc/dec

    > From: Tim Hockin [mailto:thockin@hockin.org]
    >
    > On Tue, Oct 14, 2003 at 02:17:49PM -0700, Perez-Gonzalez, Inaky wrote:
    > > It will be in include/asm/atomic.h; however, it is not wise to
    > > use directly the kernel stuff unless you are coding kernel stuff.
    >
    > Is there any reason NOT to use the atomic ops in user-space? I mean, are
    > they privileged on some architectures, or ...? It seems like some
    > user-space apps might really benefit from simple atomic ops. Or at least,
    > kernel-coders writing in userspace could sure use simple atomic ops :)

    Well, you are right; functionally speaking, there are no concerns,
    however, there are problems.

    Not all architectures have really simple atomic operations like
    for example, ia32 or PPC. For example, Sparc has to do this ugly
    spinlock thinguie and that's why you can only count on 24 bits
    out of the whole atomic data type; another example is ARM,
    you just disables irqs and preemption, I guess, and operates), there
    is no way they will work in user space

    When you have implementations like this, where ia32 is one of the
    lucky exceptions because you can do it with a couple of asm opcodes,
    it is really impossible to offer something that can float up to
    user space.

    PS: hey, how's Mike doing? Say hi from me, pls

    Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
    (and my fault)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Richard B. Johnson: "Re: ld-Script needed OR (predicted) Architecture of Kernel 3.0 ;-)"

    Relevant Pages

    • Kernel 2.6.0-test9 Zombie Issue
      ... Zombies for any short lived processes. ... kernel. ... Is this something in the FAQ? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • ps2 mouse
      ... I compiled 2.6.1 kernel on my computer and the behavior of my mouse is ... I have read also the FAQ about problems in input subsystem for 2.6, ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • [bernie@develer.com: Kernel 2.6 size increase]
      ... code bloat can be very harmful on embedded targets, ... kernel configuration for ColdFire: ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • RE: Linux 2.6.5 emu10k1 module FAILS, built-in OK.
      ... grep: networking/netif-msg.txt: Permission denied ... this is with _SMP_ kernel only, ... Please read the FAQ at http://www.tux.org/lkml/ ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Question on atomic_inc/dec
      ... > use directly the kernel stuff unless you are coding kernel stuff. ... Is there any reason NOT to use the atomic ops in user-space? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)