Skip to contentSkip to conversation

Dead & Dying interfaces

DISCUSSION Matthew Wilcox 6 participants 8 messages Nov 15, 2002 – Dec 5, 2002

lore
Share & tools
lore
#0 lore raw

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

Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw
Quoted 5 lines · Matthew Wilcox

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

#2 lore raw
In reply to Matthew Wilcox
Quoted 11 lines · Matthew Wilcox

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

#3 lore raw
In reply to Matthew Wilcox
Quoted 3 lines · Matthew Wilcox

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

#4 lore raw
Quoted 8 lines · Greg KH
Quoted 3 lines · Matthew Wilcox

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

#5 lore raw
In reply to Matthew Wilcox
Quoted 3 lines · Matthew Wilcox

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

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#6 lore raw
Quoted 11 lines · Dave Jones
Quoted 3 lines · Matthew Wilcox

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).

Quoted 1 line

Dave

cu
Adrian

Signature · 4 lines
       "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
#7 lore raw
In reply to Matthew Wilcox
Quoted 5 lines · Matthew Wilcox

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