Re: How to write a kernel patch to expose a kernel-level function?



hzmonte@xxxxxxxxxxx wrote:
>> Why? Of what possible use could that information be? What problem are you
>> trying to solve?
>
>> A different story is that the result is probably invalid at the time your user code gets it. There
>> is no guarantee that the process is running on the reported processor anymore.
>
> I am trying to make sure sched_setaffinity() works. That system call
> allows you to restrict the execution of the calling thread on a (set
> of) particular logical processor(s). So, after I call
> sched_setaffinity(), I want to call smp_processor_id() to see if the
> thread is indeed executing on a processor selected.
>
Why not, instead, examine the kernel code related to this and see if it is
OK? Would that not be easier than tinkering with the kernel?

--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 05:15:00 up 10 days, 20:42, 5 users, load average: 4.08, 4.10, 4.09
.



Relevant Pages

  • Re: How to write a kernel patch to expose a kernel-level function?
    ... >A different story is that the result is probably invalid at the time your user code gets it. ... allows you to restrict the execution of the calling thread on a (set ...
    (comp.os.linux.misc)
  • Re: Question about restricted pointers
    ... When it says modified does it mean only during execution ... restrict int *p; ... Inside foo a is accessed through 2 different restricted pointers ...
    (comp.std.c)
  • Re: restrict vs. threads
    ... How do implementations support threads and restrict together? ... If stdio is kept thread-safe by a mutex in the FILE type, ... substitute upon access to shared data. ... the block execution to which the `restrict' pertains. ...
    (comp.std.c)
  • Re: How can you limit users to only see their processes ?
    ... first move original ps to some place like /sbin, and remove execution ... then set user ID on execution for script: ... (but I don't know if there is a kernel module paramter or smth ... > I mean if I restrict /proc but there is another way it's all in vain. ...
    (comp.unix.solaris)