Re: [PATCH 1/6] kthread: Add the helper macro kthread_run_on_cpu()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 21 Oct 2021 21:53:12 +0800
Cai Huoqing <caihuoqing@xxxxxxxxx> wrote:

> > > +/**
> > > + * kthread_run_on_cpu - create and wake a cpu bound thread.
> > > + * @threadfn: the function to run until signal_pending(current).
> > > + * @data: data ptr for @threadfn.
> > > + * @cpu: The cpu on which the thread should be bound,
> > > + * @namefmt: printf-style name for the thread. Format is restricted
> > > + *	     to "name.*%u". Code fills in cpu number.
> > > + *
> > > + * Description: Convenient wrapper for kthread_create_on_node()
> > > + * followed by wake_up_process().  Returns the kthread or
> > > + * ERR_PTR(-ENOMEM).
> > > + */
> > > +#define kthread_run_on_cpu(threadfn, data, cpu, namefmt)		  \  
> > 
> > Why is this a macro and not a static inline function?
> > 
> > -- Steve  
> Hi,Thanks for your feedback,
> 
> I think using static inline function is nice, but here try to keep
> consistent with the other macros,
> sush as kthread_create/kthread_init_work...

Which they did because they didn't want to use va_list to have variable
arguments, which you don't have.

Which begs the question, should you?

-- Steve



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux