2002-11-15 18:40:30

by Matthew Wilcox

[permalink] [raw]
Subject: Dead & Dying interfaces


We forgot to remove a lot of crap interfaces during 2.5 development.
Let's start a list now so we don't forget during 2.7.

This list is a combination of interfaces which have gone during 2.5 and
interfaces that should go during 2.7. Think of it as a `updating your
driver/filesystem to sane code' guide.

sleep_on, sleep_on_timeout, interruptible_sleep_on,
interruptible_sleep_on_timeout
-> use wait_event interfaces

flush_page_to_ram
-> Documentation/cachetlb.txt

cli, sti, save_flags
-> Documentation/cli-sti-removal.txt

pcibios_*
-> Documentation/pci.txt

virt_to_bus, bus_to_virt
-> Documentation/DMA-mapping.txt

check_region
-> Just use request_region and handle the failure

kmap
-> Use kmap_atomic instead

task queues
-> work queues

lock_kernel
-> spinlocks

smp_processor_id
-> get_cpu

--
Revolutions do not require corporate support.


2002-11-15 18:57:18

by William Lee Irwin III

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Fri, Nov 15, 2002 at 06:47:25PM +0000, Matthew Wilcox wrote:
> We forgot to remove a lot of crap interfaces during 2.5 development.
> Let's start a list now so we don't forget during 2.7.
> This list is a combination of interfaces which have gone during 2.5 and
> interfaces that should go during 2.7. Think of it as a `updating your
> driver/filesystem to sane code' guide.

It's very possible (and in fact bugfixing) to incrementally convert
callers of these interfaces, even during freezes or stable releases.
A bugfix is a bugfix. =)


Cheers,
Bill

2002-11-16 02:16:16

by Alan

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Fri, 2002-11-15 at 18:47, Matthew Wilcox wrote:
>
> We forgot to remove a lot of crap interfaces during 2.5 development.
> Let's start a list now so we don't forget during 2.7.
>
> This list is a combination of interfaces which have gone during 2.5 and
> interfaces that should go during 2.7. Think of it as a `updating your
> driver/filesystem to sane code' guide.
>
> sleep_on, sleep_on_timeout, interruptible_sleep_on,
> interruptible_sleep_on_timeout
> -> use wait_event interfaces

We need to fix wait_event first, probably to do event variables of some
kind (wait_nonzero_interruptible() etc).

get_cpu is the wrong thing in several places too

2002-11-17 00:40:02

by Greg KH

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Fri, Nov 15, 2002 at 06:47:25PM +0000, Matthew Wilcox wrote:
>
> pcibios_*
> -> Documentation/pci.txt

I still have patches that remove all of the instances of this. I think
it's already in the -ac kernel. I'll forward port it next week and send
it to Linus.

thanks,

greg k-h

2002-11-17 01:09:44

by Alan

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Sun, 2002-11-17 at 00:41, Greg KH wrote:
> On Fri, Nov 15, 2002 at 06:47:25PM +0000, Matthew Wilcox wrote:
> >
> > pcibios_*
> > -> Documentation/pci.txt
>
> I still have patches that remove all of the instances of this. I think
> it's already in the -ac kernel. I'll forward port it next week and send
> it to Linus.

Its in the -ac tree. No problems reported except the pcmcia bug which
you sent a patch for

2002-11-18 17:50:40

by Dave Jones

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Fri, Nov 15, 2002 at 06:47:25PM +0000, Matthew Wilcox wrote:

> This list is a combination of interfaces which have gone during 2.5 and
> interfaces that should go during 2.7. Think of it as a `updating your
> driver/filesystem to sane code' guide.

Adding printk (KERN_DEBUG "Usage of check_region() is deprecated");
to such interfaces may be an idea. For some of them, however it
is probably a bad idea if the logs get flooded with zillions of warnings
each boot. Maybe just for the "We really should purge this crap next
time" functions ?

Dave

--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs

2002-11-19 18:54:51

by Adrian Bunk

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Mon, Nov 18, 2002 at 05:55:35PM +0000, Dave Jones wrote:
> On Fri, Nov 15, 2002 at 06:47:25PM +0000, Matthew Wilcox wrote:
>
> > This list is a combination of interfaces which have gone during 2.5 and
> > interfaces that should go during 2.7. Think of it as a `updating your
> > driver/filesystem to sane code' guide.
>
> Adding printk (KERN_DEBUG "Usage of check_region() is deprecated");
> to such interfaces may be an idea. For some of them, however it
> is probably a bad idea if the logs get flooded with zillions of warnings
> each boot. Maybe just for the "We really should purge this crap next
> time" functions ?

What about a #warning? With a #warning everyone compiling this code sees
that there's something that needs updating but it doesn't flood the logs
of users (#warning was already used for linux/malloc.h in 2.4).

> Dave

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2002-12-05 04:18:20

by William Lee Irwin III

[permalink] [raw]
Subject: Re: Dead & Dying interfaces

On Fri, Nov 15, 2002 at 06:47:25PM +0000, Matthew Wilcox wrote:
> We forgot to remove a lot of crap interfaces during 2.5 development.
> Let's start a list now so we don't forget during 2.7.
> This list is a combination of interfaces which have gone during 2.5 and
> interfaces that should go during 2.7. Think of it as a `updating your
> driver/filesystem to sane code' guide.

do_each_thread()/for_each_process():
------------------------------------
(1) reserved for special "catastrophic" operations
e.g. OOM, killall, cap_set_all(), etc.
(2) use for_each_task_pid() or maintain lists/tables of tasks etc. instead
(3) kernel API is missing some pieces to make it avoidable for all callers


Bill