mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Use of yield() in the kernel
@ 2002-10-15 13:36 Duncan Sands
  2002-10-15 15:15 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Duncan Sands @ 2002-10-15 13:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

The semantics of sched_yield() changed in the 2.5 kernel.
In the 2.4 series it meant "sleep a little".
The new 2.5 semantics are correct (move to the end of the
run queue) but can mean "sleep a lot" under load.

This already bit ext3 transaction batching, c.f. Andrew Morton's

>[PATCH] remove the sched_yield from the ext3 fsync path
>
>The changed sched_yield() semantics have made ext3's transaction
>batching terribly slow.
>
>Apparently a schedule() fixes that, although it probably breaks
>transaction batching.
>
>This patch largely fixes my complaints about the new scheduler being
>extremely sluggish to interactive applications.  Evidently those
>applications were calling fsync() and were spending extremely long
>periods in sched_yield().

Maybe it is worth auditing the kernel source files using yield()?
[There are only 33 of them, so not too bad - see below].
A number of them have comments like /* sleep a little */, so the
authors presumably weren't expecting to get "sleep a lot"...

Here is the list of files using yield(), excluding non-i386 arch specific files:

net/ipv4/tcp_output.c
net/sched/sch_generic.c
net/sunrpc/sched.c
net/unix/af_unix.c
net/socket.c
mm/oom_kill.c
mm/page_alloc.c
kernel/sched.c (in migration_call)
kernel/softirq.c
kernel/suspend.c
init/do_mounts.c
fs/jbd/journal.c
fs/jbd/revoke.c
fs/nfs/pagelist.c
fs/reiserfs/journal.c
fs/ufs/truncate.c
fs/buffer.c
fs/exec.c
fs/locks.c
fs/super.c
drivers/cdrom/cdu31a.c
drivers/cdrom/sonycd535.c
drivers/ide/ide-disk.c
drivers/message/i2o/i2o_core.c
drivers/net/e100/e100_eeprom.c
drivers/net/e100/e100_main.c
drivers/net/e100/e100_phy.c
drivers/net/e100/e100_test.c
drivers/net/depca.c
drivers/net/sb1000.c
drivers/net/sis900.c
drivers/net/slip.c
arch/i386/mm/fault.c

Thoughts?

Duncan.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Use of yield() in the kernel
@ 2002-10-15 16:20 Marc-Christian Petersen
  2002-10-15 16:27 ` Duncan Sands
  0 siblings, 1 reply; 15+ messages in thread
From: Marc-Christian Petersen @ 2002-10-15 16:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Duncan Sands

Hi Duncan,

> The semantics of sched_yield() changed in the 2.5 kernel.
> In the 2.4 series it meant "sleep a little".
> The new 2.5 semantics are correct (move to the end of the
> run queue) but can mean "sleep a lot" under load.
>
> This already bit ext3 transaction batching, c.f. Andrew Morton's
>
>> [PATCH] remove the sched_yield from the ext3 fsync path
where did you read this ^^? :)

ciao, Marc

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-10-25 14:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-15 13:36 Use of yield() in the kernel Duncan Sands
2002-10-15 15:15 ` Ingo Molnar
2002-10-15 17:12 ` John Levon
2002-10-17  6:36   ` Duncan Sands
2002-10-18 18:26 ` Pavel Machek
2002-10-19 12:25   ` Duncan Sands
2002-10-19 22:00     ` Pavel Machek
2002-10-20  9:10       ` Duncan Sands
2002-10-22 17:24         ` Mark Mielke
2002-10-22 18:58           ` Duncan Sands
2002-10-25 14:15           ` Duncan Sands
2002-10-20 11:22       ` Duncan Sands
2002-10-15 16:20 Marc-Christian Petersen
2002-10-15 16:27 ` Duncan Sands
2002-10-25  8:43   ` Duncan Sands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®