Re: [PATCH 15/15] Add DEFINE_SPUFS_ATTRIBUTE()



On Wednesday 12 September 2007, Michael Ellerman wrote:
On Wed, 2007-09-12 at 17:43 +1000, Michael Ellerman wrote:
This patch adds DEFINE_SPUFS_ATTRIBUTE(), a wraper around
DEFINE_SIMPLE_ATTRIBUTE which does the specified locking for the get
routine for us.

Unfortunately we need two get routines (a locked and unlocked version) to
support the coredump code. This patch hides one of those (the locked version)
inside the macro foo.


jk said:
"Good god man!"

Yeah, I'm a bit lukewarm on this one. But the diffstat is nice, 50% code
reduction ain't bad :)

Have you looked at the change in object code size? I would expect the
object code to actually become bigger. I also think that it hurts
readability rather than help it.

Maybe a better solution is to change the core dump code to not
require the mutex to be held in the first place. By the time
we get to call the get functions, it should already be in
saved state and no longer be able to get scheduled, so we might
not actually need all the extra tricks with avoiding the
mutex to be taken again.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH 15/15] Add DEFINE_SPUFS_ATTRIBUTE()
    ... routine for us. ... Have you looked at the change in object code size? ... require the mutex to be held in the first place. ... the acquire we do in the first coredump callback is the first the SPU ...
    (Linux-Kernel)
  • Re: c++ calling c functions
    ... Thus I gave the general method for making C object code available ... routine, but a C routine, and is to be so linked. ... being called from C (printing sizeof int for sizeof 'a'). ...
    (comp.lang.c)
  • Re: c++ calling c functions
    ... Thus I gave the general method for making C object code available ... void func(int i, char c, float x); ... routine, but a C routine, and is to be so linked. ... I believe you will find that all the standard C headers are wrapped ...
    (comp.lang.c)
  • Re: C++ Function Static Initialization, Thread-Safe?
    ... void* thread{ ... that says you cannot take a mutex in the `init' routine. ... It's just a problem of waiting for something ...
    (comp.programming.threads)
  • Re: Mutex
    ... I try to use Mutex in my driver program and it does not work as i expect. ... When dma finish his job hi will call interrupt callback function. ... Do you mean Interrupt Service Routine? ...
    (microsoft.public.development.device.drivers)