2002-10-14 18:56:27

by Max Krasnyansky

[permalink] [raw]
Subject: [RFC] Rename _bh to _softirq

Hi Folks,

Old BHs have been almost completely replaced with tasklets and softirqs.
Should we then rename _bh to _softirq ?
i.e
local_bh_disable() -> local_softirq_disable()
spin_lock_bh() -> spin_lock_softirq()
bh_lock_sock() -> softirq_sock_lock()
etc

Or maybe just 'si' if softirq is too long.

bh prefix and postfix seem to be confusing now.



Max

http://bluez.sf.net
http://vtun.sf.net


2002-10-14 19:04:23

by Ingo Molnar

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq


On Mon, 14 Oct 2002, Maksim (Max) Krasnyanskiy wrote:

> Old BHs have been almost completely replaced with tasklets and softirqs.
> Should we then rename _bh to _softirq ?
> i.e
> local_bh_disable() -> local_softirq_disable()
> spin_lock_bh() -> spin_lock_softirq()
> bh_lock_sock() -> softirq_sock_lock()
> etc

i wanted to do this as part of the irqlock cleanups, but generally we dont
change existing interfaces unless it's really universally agreed upon. Eg.
we had cli() around for a *long* time although it's an x86 (-mostly)
instruction name. But yes, i agree, and there are a number of other
renames that would make perfect sense.

Ingo

2002-10-14 19:07:45

by Jeff Garzik

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

Maksim (Max) Krasnyanskiy wrote:
> Hi Folks,
>
> Old BHs have been almost completely replaced with tasklets and softirqs.


In 2.5? They have been replaced by work queues... though in some cases
manual conversion to tasklets is more appropriate.

Jeff



2002-10-14 19:14:05

by dijital1

[permalink] [raw]
Subject: THIS_MODULE->name="";

Should there be a check in sys_module_init to check for a 0 lenth name
being specified in struct module? If THIS_MODULE->name=""; is added
within a kernel module, future attempts to load, unload and query a module
will fail. I can't think of any reason why someone should need to ability
to set a 0 length name.

-Ron

"the illiterate of the future are not those who can neither read or write
but those that cannot learn, unlearn and relearn"

2002-10-14 19:53:01

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

At 09:21 PM 10/14/2002 +0200, Ingo Molnar wrote:

>On Mon, 14 Oct 2002, Maksim (Max) Krasnyanskiy wrote:
>
> > Old BHs have been almost completely replaced with tasklets and softirqs.
> > Should we then rename _bh to _softirq ?
> > i.e
> > local_bh_disable() -> local_softirq_disable()
> > spin_lock_bh() -> spin_lock_softirq()
> > bh_lock_sock() -> softirq_sock_lock()
> > etc
>
>i wanted to do this as part of the irqlock cleanups, but generally we dont
>change existing interfaces unless it's really universally agreed upon. Eg.
>we had cli() around for a *long* time although it's an x86 (-mostly)
>instruction name. But yes, i agree, and there are a number of other
>renames that would make perfect sense.

We can keep compatibility defines, just like we have for cli().
i.e.
#define local_bh_disable local_softirq_disable

Max


2002-10-14 19:59:41

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

At 03:12 PM 10/14/2002 -0400, Jeff Garzik wrote:
>Maksim (Max) Krasnyanskiy wrote:
>>Hi Folks,
>>Old BHs have been almost completely replaced with tasklets and softirqs.
>
>In 2.5? They have been replaced by work queues...
>though in some cases manual conversion to tasklets is more appropriate.
Task queues were replaced with work queues. I'm taking about things like
NET_BH, TIMER_BH, etc.
In general what's been called "bottom half" is now referred to as "softirq".

Max


2002-10-15 01:56:07

by Alexey Kuznetsov

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

Hello!

> But yes, i agree, and there are a number of other
> renames that would make perfect sense.

Oh, do you dislike names with history? I love them. :-)
Well, bh is short, looks nice and cryptic enough.

After true BHs have gone, just say that "bh" is alias for "softirq".

Alexey

2002-10-15 16:28:34

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

At 05:57 AM 10/15/2002 +0400, [email protected] wrote:
>Hello!
>
> > But yes, i agree, and there are a number of other
> > renames that would make perfect sense.
>
>Oh, do you dislike names with history? I love them. :-)
>Well, bh is short, looks nice and cryptic enough.
>
>After true BHs have gone, just say that "bh" is alias for "softirq".
Sure. Just like I said we can keep compatibility defines
#define local_bh_disable local_softirq_disable

But primary interface should be changed IMO.

Max


2002-10-15 17:48:14

by David Miller

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

From: "Maksim (Max) Krasnyanskiy" <[email protected]>
Date: Tue, 15 Oct 2002 09:34:02 -0700

But primary interface should be changed IMO.

I totally disagree.

Keep _bh, it's cool.

2002-10-15 19:18:56

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

At 10:44 AM 10/15/2002 -0700, David S. Miller wrote:
> From: "Maksim (Max) Krasnyanskiy" <[email protected]>
> Date: Tue, 15 Oct 2002 09:34:02 -0700
>
> But primary interface should be changed IMO.
>
>I totally disagree.
Care to explain why ?

>Keep _bh, it's cool.
But pretty much meaningless. _softirq on the other hand clearly shows what
it does.
We don't give names to a functions based on the coolness, do we ? ;-)

btw _si would be equally cool.

Max

2002-10-15 19:43:58

by David Miller

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

From: "Maksim (Max) Krasnyanskiy" <[email protected]>
Date: Tue, 15 Oct 2002 12:24:18 -0700

We don't give names to a functions based on the coolness, do we ?
;-)

cli() was cool too.

Just because you don't see that a base handler really is an
alias for softirq these days, doesn't mean we should delete
it.

2002-10-15 19:50:19

by Oliver Xymoron

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

On Tue, Oct 15, 2002 at 12:24:18PM -0700, Maksim (Max) Krasnyanskiy wrote:
> At 10:44 AM 10/15/2002 -0700, David S. Miller wrote:
> > From: "Maksim (Max) Krasnyanskiy" <[email protected]>
> > Date: Tue, 15 Oct 2002 09:34:02 -0700
> >
> > But primary interface should be changed IMO.
> >
> >I totally disagree.
> Care to explain why ?
>
> >Keep _bh, it's cool.
> But pretty much meaningless.

No, now it clearly means buffer head.

--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."

2002-10-15 20:18:24

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

At 12:42 PM 10/15/2002 -0700, David S. Miller wrote:
> From: "Maksim (Max) Krasnyanskiy" <[email protected]>
> Date: Tue, 15 Oct 2002 12:24:18 -0700
>
> We don't give names to a functions based on the coolness, do we ?
> ;-)
>
>cli() was cool too.
But we did rename it.

>Just because you don't see that a base handler really is an
>alias for softirq these days, doesn't mean we should delete it.
Dave, you just confirmed that _bh is indeed confusing. And some
people don't even know what it is ;-).
_bh is not a "base handler" it stands for "bottom half".

Max





2002-10-15 20:21:28

by David Miller

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

From: "Maksim (Max) Krasnyanskiy" <[email protected]>
Date: Tue, 15 Oct 2002 13:23:28 -0700

_bh is not a "base handler" it stands for "bottom half".

All of these phrases mean the same thing to me.

Do you want to know what is different? "tasklets",
they are a totally different abstraction, as are
"work queues".

"base handler" and "bottom half" all refer to an execution
context, and these days that means softirq.





2002-10-15 20:25:05

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

Oliver,

> > > But primary interface should be changed IMO.
> > >
> > >I totally disagree.
> > Care to explain why ?
> >
> > >Keep _bh, it's cool.
> > But pretty much meaningless.
>
>No, now it clearly means buffer head.
Another point in favor of renaming :).

local_bh_disable() disables local _softirqs_ not "local buffer head".

Max

2002-10-15 20:58:25

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

At 01:19 PM 10/15/2002 -0700, David S. Miller wrote:
> From: "Maksim (Max) Krasnyanskiy" <[email protected]>
> Date: Tue, 15 Oct 2002 13:23:28 -0700
>
> _bh is not a "base handler" it stands for "bottom half".
>
>All of these phrases mean the same thing to me.
>
>Do you want to know what is different? "tasklets",
>they are a totally different abstraction,
tasklets are softirqs. I mean they aren't much different. Tasklets are
executed
from the softirq, so they have same context and stuff.

>as are "work queues"
Yep. These are different, because they are executed in process context.

>"base handler" and "bottom half" all refer to an execution
>context, and these days that means softirq.
I guess we should then have some kinda readme that explains what
all those things are. And the BH context covers softirqs and tasklets.

Max

2002-10-15 21:12:37

by Ingo Molnar

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq


On Tue, 15 Oct 2002, Maksim (Max) Krasnyanskiy wrote:

> tasklets are softirqs. I mean they aren't much different. Tasklets are
> executed from the softirq, so they have same context and stuff.

well, tasklets are a subset of softirqs, in that the code triggered by a
tasklet can run only on one CPU at once. Ie. they are a special kind of
softirq that knows about global things like "I'm executing currently".

Ie., just to confuse things, they are similar to what old-BHs used to be,
with the difference that the enumeration of tasklets is much nicer
(pointer based and can be embedded in any structure), not some global
registry of integers like old-BHs were.

(tasklets can also be scheduled via two priority levels: a 'high' priority
scheduling and a 'low' priority scheduling. old-BHs used to have fixed
priority levels directly attached to their global enumeration integer
values.)

Ingo

2002-10-15 21:05:25

by Ingo Molnar

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq


On Tue, 15 Oct 2002, David S. Miller wrote:

> _bh is not a "base handler" it stands for "bottom half".
>
> "base handler" and "bottom half" all refer to an execution context,
> and these days that means softirq.

i think i agree with you.

- we have 'top half' contexts, which are also called 'hardirqs'.

- then we have 'bottom half' contexts, which are also called 'softirqs'.

the fact that 'bottom halves' used to be an earlier concept that had a
slightly different meaning from 'softirqs' for a limited amount of time
does not remove from the meaningfulness of the naming itself. Today
'bottom halves' and 'softirqs' are the same thing.

Ingo

2002-10-15 21:01:42

by David Miller

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

From: "Maksim (Max) Krasnyanskiy" <[email protected]>
Date: Tue, 15 Oct 2002 14:02:22 -0700

I guess we should then have some kinda readme that explains what
all those things are. And the BH context covers softirqs and tasklets.

That sounds fine.

2002-10-15 21:10:07

by Ingo Molnar

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq


On Tue, 15 Oct 2002, Maksim (Max) Krasnyanskiy wrote:

> >No, now it clearly means buffer head.
> Another point in favor of renaming :).
>
> local_bh_disable() disables local _softirqs_ not "local buffer head".

they seldom occur in the same neighborhood - i've never mistaken buffer
heads for bottom halves.

Ingo

2002-10-15 21:29:33

by Brad Hards

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 16 Oct 2002 06:58, David S. Miller wrote:
> From: "Maksim (Max) Krasnyanskiy" <[email protected]>
> Date: Tue, 15 Oct 2002 14:02:22 -0700
>
> I guess we should then have some kinda readme that explains what
> all those things are. And the BH context covers softirqs and tasklets.
>
> That sounds fine.
Documentation/DocBook/kernel-hacking.tmpl

It is such a fine idea, Rusty already did it...

Brad

- --
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9rIg1W6pHgIdAuOMRAv7zAJ95Eo1zgh2LWYxesk+LlWQ+U8O2OACfb8Qa
Kfx4vfcbofHxfr6muMvi1WE=
=1Ukc
-----END PGP SIGNATURE-----

2002-10-15 22:26:03

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [RFC] Rename _bh to _softirq


> > "base handler" and "bottom half" all refer to an execution context,
> > and these days that means softirq.
>
>i think i agree with you.
>
>- we have 'top half' contexts, which are also called 'hardirqs'.
>
>- then we have 'bottom half' contexts, which are also called 'softirqs'.
>
>the fact that 'bottom halves' used to be an earlier concept that had a
>slightly different meaning from 'softirqs' for a limited amount of time
>does not remove from the meaningfulness of the naming itself. Today
>'bottom halves' and 'softirqs' are the same thing.

I still think we should rename _bh thing :). At least for consistent naming.
We have things like:
in_softirq()
do_softirq()
sofirq_pending()
and
local_bh_disable()
local_bh_enable()

Anyway, I'll go ahead and shut up :). Most people didn't seem to like that
proposal :(.

Max