Skip to contentSkip to conversation

synchronize_net()?

DISCUSSION Mitchell Blank Jr 2 participants 2 messages Sep 13, 2003 – Sep 14, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

In 2.6.0-test5, synchronize_net() is simply:

/* Synchronize with packet receive processing. */
void synchronize_net(void)

{
        might_sleep();
        synchronize_kernel();
}

The "might_sleep()" isn't needed -- synchronize_kernel() calls wait_for_completion() which also calls it. Is there any reason for keeping synchronize_net() around as a seperate function? Maybe it should just be a #define instead.

-Mitch

#1 lore raw
Quoted 8 lines · On Fri, 12 Sep 2003 20:46:11 -0700 Mitchell Blank Jr <[email protected]> wrote:

/* Synchronize with packet receive processing. */
void synchronize_net(void)

{
        might_sleep();
        synchronize_kernel();
}

The "might_sleep()" isn't needed

As a matter of taste and ease of debugging it could be.

I think it's logical to place the might_sleep() calls as high up in the call chain as is reasonable. This is especially true for important oft-used interfaces for a subsystem.

In this way, you don't risk so much having a hard to decode backtrace that misses the true culprit sleep'able call.