Skip to contentSkip to conversation

cfq-iosched.c:RB_CLEAR_COLOR

DISCUSSION David Miller 4 participants 4 messages Jun 21, 2006

lore
Share & tools
lore
#0 lore raw

That got removed in Linus's tree today, yet cfq-iosched.c still contains a reference to it.

The culprit changeset seems to be 3db3a44.

There were two explicit calls in the cfq-iosched.c file to RB_CLEAR_COLOR, only the one in cfq_del_crq_rb() got removed so the build fails.

#1 lore raw
Quoted 9 lines · David Miller

That got removed in Linus's tree today, yet cfq-iosched.c still contains a reference to it.

The culprit changeset seems to be 3db3a44.

There were two explicit calls in the cfq-iosched.c file to RB_CLEAR_COLOR, only the one in cfq_del_crq_rb() got removed so the build fails.

I think the right fix is to just remove the RB_CLEAR_COLOR() call, since the memset will set everything to 0/NULL, which should be the correct initialization these days anyway.

David (the other one - dwmw2), pls confirm?

Linus

#2 lore raw
Quoted 3 lines · Linus Torvalds
Quoted 3 lines

There were two explicit calls in the cfq-iosched.c file to RB_CLEAR_COLOR, only the one in cfq_del_crq_rb() got removed so the build fails.

Apologies for that; the new one got added only last week, and escaped my attention.

Quoted 5 lines

I think the right fix is to just remove the RB_CLEAR_COLOR() call, since the memset will set everything to 0/NULL, which should be the correct initialization these days anyway.

David (the other one - dwmw2), pls confirm?

Yes, that looks correct. Other code, including the AS scheduler, was (ab)using the colour field by storing a 'RB_NONE' value which was neither red nor black to mark an 'off-tree' node, then checking for it with ON_RB(). I changed that scheme -- we now set the node's parent pointer to point to itself to mark an off-tree node.

However, the cfq scheduler looks like it only inherited the macros from AS, and was never actually _checking_ if a given node was on-tree or not. So just dropping the magic initialisation stuff there is fine.

Signature · 1 line
dwmw2
#3 lore raw
Quoted 20 lines · David Woodhouse
Quoted 3 lines · Linus Torvalds
Quoted 3 lines

There were two explicit calls in the cfq-iosched.c file to RB_CLEAR_COLOR, only the one in cfq_del_crq_rb() got removed so the build fails.

Apologies for that; the new one got added only last week, and escaped my attention.

Quoted 5 lines

I think the right fix is to just remove the RB_CLEAR_COLOR() call, since the memset will set everything to 0/NULL, which should be the correct initialization these days anyway.

David (the other one - dwmw2), pls confirm?

Yes, that looks correct. Other code, including the AS scheduler, was (ab)using the colour field by storing a 'RB_NONE' value which was neither red nor black to mark an 'off-tree' node, then checking for it with ON_RB(). I changed that scheme -- we now set the node's parent pointer to point to itself to mark an off-tree node.

Quoted 3 lines

However, the cfq scheduler looks like it only inherited the macros from AS, and was never actually _checking_ if a given node was on-tree or not. So just dropping the magic initialisation stuff there is fine.

I cleaned up the ioscheduler rb private defines now, instead of having each roll their own. Result is here:

http://brick.kernel.dk/git/?p=linux-2.6-block.git;a=commitdiff;h=52e7beda68fe0b08d74b6665d47e6024efe46101

Signature · 1 line
Jens Axboe