> Some archs already have an atomic_dec_if_positive() (see for instance > the PPC). It won't take much work to convert that to an > atomic_inc_if_positive(). > > For those arches that don't have that sort of thing, then writing a > generic atomic_inc_if_positive() using cmpxchg() will often be possible, > but there are exceptions (for instance the original 386 does not have a > cmpxchg, so there you will have to use something else). The problem with introducing architecture specific code, is that it's just asking for new bugs. If it's something used all over the kernel, than obviously it's OK, but for the sake of just one caller it's a bit crazy I think. Miklos - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- From: Jamie Lokier <[email protected]>
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- References:
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- From: Miklos Szeredi <[email protected]>
- [PATCH] fix race in mark_mounts_for_expiry()
- From: Miklos Szeredi <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Ram <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Miklos Szeredi <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Miklos Szeredi <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Ram <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Jamie Lokier <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Ram <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Miklos Szeredi <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Jamie Lokier <[email protected]>
- Re: [PATCH] namespace.c: fix bind mount from foreign namespace
- From: Miklos Szeredi <[email protected]>
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- From: David Howells <[email protected]>
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- From: David Howells <[email protected]>
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- From: Miklos Szeredi <[email protected]>
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- From: Trond Myklebust <[email protected]>
- Re: [PATCH] fix race in mark_mounts_for_expiry()
- Prev by Date: Re: [SMP NICE] [PATCH] SCHED: Implement nice support across physical cpus on SMP
- Next by Date: Re: Detecting link up
- Previous by thread: Re: [PATCH] fix race in mark_mounts_for_expiry()
- Next by thread: Re: [PATCH] fix race in mark_mounts_for_expiry()
- Index(es):