Skip to contentSkip to conversation

EDAC: switch to kthread_ API

PATCH Doug Thompson 3 participants 3 messages Mar 3, 2006 – Mar 4, 2006

lore
Share & tools
lore
#0 lore raw

Originally we used a timeout, but when I added the PCI Parity scanning, that broke while trying to get a PCI spinlock (via a PCI API call) during the timer interrupt time. I then added the current kernel thread model and a first attempt. We subsequently received input for the kthread_* model which is were this patch came from.

Currently the timer event code performs two operations:

1) ECC polling and
2) PCI parity polling.

I want to split those from each other, so each can have a seperate cycle rate (also adding a sysfs cycle control for the PCI parity timing in addition to the existing ECC cycle control).

One of the thoughts I have had in this refactoring is to utilize worker queue processing to do the work (and bypass the spinlock issue) which is triggered by the timer event for PCI parity polling and thus also the ECC polling for uniformity.

Thoughts are welcome

doug thompson

Quoted 27 lines · Arjan van de Ven
Quoted 11 lines · Andrew Morton
Quoted 4 lines · Dave Peterson

schedule_timeout((HZ * poll_msec) / 1000); try_to_freeze();
+ __set_current_state(TASK_RUNNING);

schedule() and schedule_timeout*() always return in state TASK_RUNNING, so I'll take that out of there.

We might as well use schedule_timeout_interruptible(), too. As a bonus, we get to delete that spelling mistake ;)

or even msleep variant ;)

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
bluesmoke-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluesmoke-devel

#1 lore raw
Quoted 8 lines · Doug Thompson

Currently the timer event code performs two operations:

1) ECC polling and
2) PCI parity polling.

I want to split those from each other, so each can have a seperate cycle rate (also adding a sysfs cycle control for the PCI parity timing in addition to the existing ECC cycle control).

Yes, this sounds like a good idea. Using schedule_delayed_work() to independently implement each polling cycle, we should be able to get rid of the EDAC kernel thread.

#2 lore raw
Quoted 7 lines · Dave Peterson
Quoted 5 lines · Doug Thompson

Currently the timer event code performs two operations:

1) ECC polling and
2) PCI parity polling.

Quoted 7 lines
Quoted 3 lines

I want to split those from each other, so each can have a seperate cycle rate (also adding a sysfs cycle control for the PCI parity timing in addition to the existing ECC cycle control).

Yes, this sounds like a good idea. Using schedule_delayed_work() to independently implement each polling cycle, we should be able to get rid of the EDAC kernel thread.

That would suit. One needs to be quite careful about killing everything off in the close->rmmod side of things, especially if the delayed work handler re-arms itself. We have a pending (and possibly executing) timer handler to worry about, then a pending (and possibly executing) keventd handler to worry about.

We've got this cancel_rearming_delayed_work() thing - I was never terribly happy about it, but I think it works.