Skip to contentSkip to conversation

sched.h header cleanups vs. 2.6.9-rc2-mm3

PATCH In review William Lee Irwin III 3 participants 14 messages Sep 25, 2004 – Sep 26, 2004

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

cover sched.h header cleanups vs. 2.6.9-rc2-mm3

I split off the most easily mergeable parts of some sched.h header cleanups I wrote that better than halved the size of sched.h. In particular, these are the parts that don't require large sweeps, uninlining, or introducing new headers. Compiletested on x86-64.

-- wli

#1 lore raw

PATCH 1/8 nuke itimer_ticks and itimer_next

Quoted 4 lines · William Lee Irwin III

I split off the most easily mergeable parts of some sched.h header cleanups I wrote that better than halved the size of sched.h. In particular, these are the parts that don't require large sweeps, uninlining, or introducing new headers. Compiletested on x86-64.

Remove itimer_next and itimer_ticks; they are nowhere defined and referenced nowhere else.

include/linux/sched.h +0 -2
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -939,8 +939,6 @@
 
 #include <asm/current.h>
 
-extern unsigned long itimer_ticks;
-extern unsigned long itimer_next;
 extern void do_timer(struct pt_regs *);
 
 extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state));
#2 lore raw

PATCH 2/8 nuke CT_TO_SECS() and CT_TO_USECS()

Quoted 2 lines · William Lee Irwin III

Remove itimer_next and itimer_ticks; they are nowhere defined and referenced nowhere else.

CT_TO_SECS() and CT_TO_USECS() are used where jiffies_to_timeval() should be; this patch teaches their sole caller to use that instead and by so doing removes them from the kernel entirely.

arch/mips/kernel/irixelf.c +5 -8
Index: mm3-2.6.9-rc2/arch/mips/kernel/irixelf.c
===================================================================
@@ -29,6 +29,7 @@
 #include <linux/personality.h>
 #include <linux/elfcore.h>
 #include <linux/smp_lock.h>
+#include <linux/jiffies.h>
 
 #include <asm/uaccess.h>
 #include <asm/mipsregs.h>
@@ -1131,14 +1132,10 @@
 	psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid;
 	psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current);
 	psinfo.pr_sid = prstatus.pr_sid = current->signal->session;
-	prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime);
-	prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime);
-	prstatus.pr_stime.tv_sec = CT_TO_SECS(current->stime);
-	prstatus.pr_stime.tv_usec = CT_TO_USECS(current->stime);
-	prstatus.pr_cutime.tv_sec = CT_TO_SECS(current->cutime);
-	prstatus.pr_cutime.tv_usec = CT_TO_USECS(current->cutime);
-	prstatus.pr_cstime.tv_sec = CT_TO_SECS(current->cstime);
-	prstatus.pr_cstime.tv_usec = CT_TO_USECS(current->cstime);
+	jiffies_to_timeval(current->utime, &prstatus.pr_utime);
+	jiffies_to_timeval(current->stime, &prstatus.pr_stime);
+	jiffies_to_timeval(current->cutime, &prstatus.pr_cutime);
+	jiffies_to_timeval(current->cstime, &prstatus.pr_cstime);
 	if (sizeof(elf_gregset_t) != sizeof(struct pt_regs)) {
 		printk("sizeof(elf_gregset_t) (%d) != sizeof(struct pt_regs) "
 		       "(%d)\n", sizeof(elf_gregset_t), sizeof(struct pt_regs));
include/linux/sched.h +0 -3
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -85,9 +85,6 @@
 	load += n*(FIXED_1-exp); \
 	load >>= FSHIFT;
 
-#define CT_TO_SECS(x)	((x) / HZ)
-#define CT_TO_USECS(x)	(((x) % HZ) * 1000000/HZ)
-
 extern int nr_threads;
 extern int last_pid;
 DECLARE_PER_CPU(unsigned long, process_counts);
#3 lore raw

PATCH 3/8 privatize CALC_LOAD()

Quoted 3 lines · William Lee Irwin III

CT_TO_SECS() and CT_TO_USECS() are used where jiffies_to_timeval() should be; this patch teaches their sole caller to use that instead and by so doing removes them from the kernel entirely.

CALC_LOAD() is used nowhere but kernel/timer.c; this patch moves it there.

include/linux/sched.h +0 -9
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -75,15 +75,6 @@
 
 #define FSHIFT		11		/* nr of bits of precision */
 #define FIXED_1		(1<<FSHIFT)	/* 1.0 as fixed-point */
-#define LOAD_FREQ	(5*HZ)		/* 5 sec intervals */
-#define EXP_1		1884		/* 1/exp(5sec/1min) as fixed-point */
-#define EXP_5		2014		/* 1/exp(5sec/5min) */
-#define EXP_15		2037		/* 1/exp(5sec/15min) */
-
-#define CALC_LOAD(load,exp,n) \
-	load *= exp; \
-	load += n*(FIXED_1-exp); \
-	load >>= FSHIFT;
 
 extern int nr_threads;
 extern int last_pid;
kernel/timer.c +15 -5
Index: mm3-2.6.9-rc2/kernel/timer.c
===================================================================
@@ -884,6 +884,16 @@
  */
 unsigned long avenrun[3];
 
+#define EXP_1		1884		/* 1/exp(5sec/1min) as fixed-point */
+#define EXP_5		2014		/* 1/exp(5sec/5min) */
+#define EXP_15		2037		/* 1/exp(5sec/15min) */
+
+static inline unsigned long
+__calc_load(unsigned long prev, unsigned long decay, unsigned long new)
+{
+	return (decay*prev + (FIXED_1 - decay)*new) >> FSHIFT;
+}
+
 /*
  * calc_load - given tick count, update the avenrun load estimates.
  * This is called while holding a write_lock on xtime_lock.
@@ -891,15 +901,15 @@
 static inline void calc_load(unsigned long ticks)
 {
 	unsigned long active_tasks; /* fixed-point */
-	static int count = LOAD_FREQ;
+	static int count = 5*HZ;
 
 	count -= ticks;
 	if (count < 0) {
-		count += LOAD_FREQ;
+		count += 5*HZ;
 		active_tasks = count_active_tasks();
-		CALC_LOAD(avenrun[0], EXP_1, active_tasks);
-		CALC_LOAD(avenrun[1], EXP_5, active_tasks);
-		CALC_LOAD(avenrun[2], EXP_15, active_tasks);
+		avenrun[0] = __calc_load(avenrun[0], EXP_1, active_tasks);
+		avenrun[1] = __calc_load(avenrun[1], EXP_5, active_tasks);
+		avenrun[2] = __calc_load(avenrun[2], EXP_15, active_tasks);
 	}
 }
 
#4 lore raw

PATCH 4/8 move struct k_itimer to posix-timers.h

Quoted 2 lines · William Lee Irwin III

CALC_LOAD() is used nowhere but kernel/timer.c; this patch moves it there.

struct k_itimer is used nowhere but posix-timers.h; this patch moves it there.

include/linux/posix-timers.h +23 -0
Index: mm3-2.6.9-rc2/include/linux/posix-timers.h
===================================================================
@@ -8,6 +8,8 @@
 	struct list_head list;
 	spinlock_t lock;
 };
+
+struct k_itimer;
 struct k_clock {
 	int res;		/* in nano seconds */
 	struct k_clock_abs *abs_struct;
@@ -23,6 +25,27 @@
 	void (*timer_get) (struct k_itimer * timr,
 			   struct itimerspec * cur_setting);
 };
+
+/* POSIX.1b interval timer structure. */
+struct k_itimer {
+	struct list_head list;		 /* free/ allocate list */
+	spinlock_t it_lock;
+	clockid_t it_clock;		/* which timer type */
+	timer_t it_id;			/* timer id */
+	int it_overrun;			/* overrun on pending signal  */
+	int it_overrun_last;		 /* overrun on last delivered signal */
+	int it_requeue_pending;          /* waiting to requeue this timer */
+	int it_sigev_notify;		 /* notify word of sigevent struct */
+	int it_sigev_signo;		 /* signo word of sigevent struct */
+	sigval_t it_sigev_value;	 /* value word of sigevent struct */
+	unsigned long it_incr;		/* interval specified in jiffies */
+	struct task_struct *it_process;	/* process to send signal to */
+	struct timer_list it_timer;
+	struct sigqueue *sigq;		/* signal queue entry. */
+	struct list_head abs_timer_entry; /* clock abs_timer_list */
+	struct timespec wall_to_prev;   /* wall_to_monotonic used when set */
+};
+
 struct now_struct {
 	unsigned long jiffies;
 };
include/linux/sched.h +0 -20
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -352,26 +352,6 @@
 struct backing_dev_info;
 struct reclaim_state;
 
-/* POSIX.1b interval timer structure. */
-struct k_itimer {
-	struct list_head list;		 /* free/ allocate list */
-	spinlock_t it_lock;
-	clockid_t it_clock;		/* which timer type */
-	timer_t it_id;			/* timer id */
-	int it_overrun;			/* overrun on pending signal  */
-	int it_overrun_last;		 /* overrun on last delivered signal */
-	int it_requeue_pending;          /* waiting to requeue this timer */
-	int it_sigev_notify;		 /* notify word of sigevent struct */
-	int it_sigev_signo;		 /* signo word of sigevent struct */
-	sigval_t it_sigev_value;	 /* value word of sigevent struct */
-	unsigned long it_incr;		/* interval specified in jiffies */
-	struct task_struct *it_process;	/* process to send signal to */
-	struct timer_list it_timer;
-	struct sigqueue *sigq;		/* signal queue entry. */
-	struct list_head abs_timer_entry; /* clock abs_timer_list */
-	struct timespec wall_to_prev;   /* wall_to_monotonic used when set */
-};
-
 #ifdef CONFIG_SCHEDSTATS
 struct sched_info {
 	/* cumulative counters */
#5 lore raw

PATCH 5/8 move struct mm_struct to mm.h

Quoted 2 lines · William Lee Irwin III

struct k_itimer is used nowhere but posix-timers.h; this patch moves it there.

This patch moves mm_struct and the helpers to handle it into mm.h

include/linux/mm.h +91 -0
Index: mm3-2.6.9-rc2/include/linux/mm.h
===================================================================
@@ -56,6 +56,7 @@
  * space that has a special rule for the page-fault handlers (ie a shared
  * library, the executable area etc).
  */
+struct mm_struct;
 struct vm_area_struct {
 	struct mm_struct * vm_mm;	/* The address space we belong to. */
 	unsigned long vm_start;		/* Our start address within vm_mm. */
@@ -109,6 +110,77 @@
 #endif
 };
 
+struct mm_struct {
+	struct vm_area_struct * mmap;		/* list of VMAs */
+	struct rb_root mm_rb;
+	struct vm_area_struct * mmap_cache;	/* last find_vma result */
+	unsigned long (*get_unmapped_area) (struct file *filp,
+				unsigned long addr, unsigned long len,
+				unsigned long pgoff, unsigned long flags);
+	void (*unmap_area) (struct vm_area_struct *area);
+	unsigned long mmap_base;		/* base of mmap area */
+	unsigned long free_area_cache;		/* first hole */
+	pgd_t * pgd;
+	atomic_t mm_users;			/* How many users with user space? */
+	atomic_t mm_count;			/* How many references to "struct mm_struct" (users count as 1) */
+	int map_count;				/* number of VMAs */
+	struct rw_semaphore mmap_sem;
+	spinlock_t page_table_lock;		/* Protects task page tables and mm->rss */
+
+	struct list_head mmlist;		/* List of maybe swapped mm's.  These are globally strung
+						 * together off init_mm.mmlist, and are protected
+						 * by mmlist_lock
+						 */
+
+	unsigned long start_code, end_code, start_data, end_data;
+	unsigned long start_brk, brk, start_stack;
+	unsigned long arg_start, arg_end, env_start, env_end;
+	unsigned long rss, total_vm, locked_vm, shared_vm;
+	unsigned long exec_vm, stack_vm, reserved_vm, def_flags, nr_ptes;
+
+	unsigned long saved_auxv[42]; /* for /proc/PID/auxv */
+
+	unsigned dumpable:1;
+	cpumask_t cpu_vm_mask;
+
+	/* Architecture-specific MM context */
+	mm_context_t context;
+
+	/* Token based thrashing protection. */
+	unsigned long swap_token_time;
+	char recent_pagein;
+
+	/* coredumping support */
+	int core_waiters;
+	struct completion *core_startup_done, core_done;
+
+	/* aio bits */
+	rwlock_t		ioctx_list_lock;
+	struct kioctx		*ioctx_list;
+
+	struct kioctx		default_kioctx;
+};
+
+extern struct mm_struct init_mm;
+
+/*
+ * Routines for handling mm_structs
+ */
+struct mm_struct *mm_alloc(void);
+/* mmput gets rid of the mappings and all user-space */
+void mmput(struct mm_struct *);
+/* Grab a reference to a task's mm, if it is not already going away */
+struct mm_struct *get_task_mm(struct task_struct *);
+/* Remove the current tasks stale references to the old mm_struct */
+void mm_release(struct task_struct *, struct mm_struct *);
+/* mmdrop drops the mm and the page tables */
+void FASTCALL(__mmdrop(struct mm_struct *));
+static inline void mmdrop(struct mm_struct *mm)
+{
+	if (atomic_dec_and_test(&mm->mm_count))
+		__mmdrop(mm);
+}
+
 /*
  * vm_flags..
  */
@@ -562,6 +634,25 @@
 	int atomic;				/* May not schedule() */
 };
 
+
+unsigned long arch_get_unmapped_area(struct file *, unsigned long,
+				unsigned long, unsigned long, unsigned long);
+unsigned long arch_get_unmapped_area_topdown(struct file *, unsigned long,
+				unsigned long, unsigned long, unsigned long);
+void arch_unmap_area(struct vm_area_struct *);
+void arch_unmap_area_topdown(struct vm_area_struct *);
+
+#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
+void arch_pick_mmap_layout(struct mm_struct *);
+#else
+static inline void arch_pick_mmap_layout(struct mm_struct *mm)
+{
+	mm->mmap_base = TASK_UNMAPPED_BASE;
+	mm->get_unmapped_area = arch_get_unmapped_area;
+	mm->unmap_area = arch_unmap_area;
+}
+#endif
+
 void zap_page_range(struct vm_area_struct *vma, unsigned long address,
 		unsigned long size, struct zap_details *);
 int unmap_vmas(struct mmu_gather **tlbp, struct mm_struct *mm,
include/linux/sched.h +1 -95

126 lines not on this page · raw message

#6 lore raw

PATCH 6/8 move aio include to mm.h

Quoted 1 line · William Lee Irwin III

This patch moves mm_struct and the helpers to handle it into mm.h

This patch moves the aio inclusion from sched.h to mm.h, while leaving workqueue.h directly included by sched.h; a large sweep is required to clean up drivers including workqueue.h indirectly via sched.h

-- wli

fs/ext3/file.c +1 -0
Index: mm3-2.6.9-rc2/fs/ext3/file.c
===================================================================
@@ -23,6 +23,7 @@
 #include <linux/jbd.h>
 #include <linux/ext3_fs.h>
 #include <linux/ext3_jbd.h>
+#include <linux/aio.h>
 #include "xattr.h"
 #include "acl.h"
 
include/linux/mm.h +1 -0
Index: mm3-2.6.9-rc2/include/linux/mm.h
===================================================================
@@ -13,6 +13,7 @@
 #include <linux/rbtree.h>
 #include <linux/prio_tree.h>
 #include <linux/fs.h>
+#include <linux/aio.h>
 
 struct mempolicy;
 struct anon_vma;
include/linux/sched.h +1 -2
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -14,6 +14,7 @@
 #include <linux/thread_info.h>
 #include <linux/cpumask.h>
 #include <linux/nodemask.h>
+#include <linux/workqueue.h>
 
 #include <asm/system.h>
 #include <asm/semaphore.h>
@@ -176,8 +177,6 @@
 
 extern int sysctl_max_map_count;
 
-#include <linux/aio.h>
-
 struct sighand_struct {
 	atomic_t		count;
 	struct k_sigaction	action[_NSIG];
#7 lore raw

PATCH 7/8 remove rbtree.h inclusion from sched.h

Quoted 3 lines · William Lee Irwin III

This patch moves the aio inclusion from sched.h to mm.h, while leaving workqueue.h directly included by sched.h; a large sweep is required to clean up drivers including workqueue.h indirectly via sched.h

This patch removes the inclusion of rbtree.h in sched.h

include/linux/sched.h +0 -1
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -10,7 +10,6 @@
 #include <linux/types.h>
 #include <linux/timex.h>
 #include <linux/jiffies.h>
-#include <linux/rbtree.h>
 #include <linux/thread_info.h>
 #include <linux/cpumask.h>
 #include <linux/nodemask.h>
#8 lore raw

PATCH 8/8 move exec_domain declarations to personality.h

Quoted 1 line · William Lee Irwin III

This patch removes the inclusion of rbtree.h in sched.h

This patch moves usage of struct exec_domain in sched.h to personality.h

include/linux/personality.h +5 -0
Index: mm3-2.6.9-rc2/include/linux/personality.h
===================================================================
@@ -91,6 +91,11 @@
 };
 
 /*
+ * The default (Linux) execution domain.
+ */
+extern struct exec_domain	default_exec_domain;
+
+/*
  * Return the base personality without flags.
  */
 #define personality(pers)	(pers & PER_MASK)
include/linux/sched.h +0 -7
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
@@ -31,8 +31,6 @@
 #include <linux/pid.h>
 #include <linux/percpu.h>
 
-struct exec_domain;
-
 /*
  * cloning flags:
  */
@@ -802,11 +800,6 @@
 
 void yield(void);
 
-/*
- * The default (Linux) execution domain.
- */
-extern struct exec_domain	default_exec_domain;
-
 union thread_union {
 	struct thread_info thread_info;
 	unsigned long stack[THREAD_SIZE/sizeof(long)];
#9 lore raw

Re: [sched.h 6/8] move aio include to mm.h

In reply to William Lee Irwin III
Quoted 3 lines · William Lee Irwin III

This patch moves the aio inclusion from sched.h to mm.h, while leaving workqueue.h directly included by sched.h; a large sweep is required to clean up drivers including workqueue.h indirectly via sched.h

FYI: the checkheaders.pl script I recently posted here gives me the following 175 results about potentially incorrect use of workqueue.h.

	Arnd <><

arch/cris/arch-v10/drivers/serial.c:4947: need linux/workqueue.h: INIT_WORK arch/cris/arch-v10/drivers/serial.h:95: need linux/workqueue.h: struct work_struct arch/ia64/hp/sim/simserial.c:749: need linux/workqueue.h: INIT_WORK arch/ia64/kernel/smpboot.c:388: need linux/workqueue.h: DECLARE_WORK arch/ppc64/kernel/spu_softirq.c:53: need linux/workqueue.h: create_workqueue arch/ppc64/kernel/spu_traps.c:988: need linux/workqueue.h: INIT_WORK arch/s390/mm/cmm.c:44: need linux/workqueue.h: struct work_struct arch/um/drivers/chan_kern.c:460: need linux/workqueue.h: struct work_struct arch/um/drivers/line.c:239: need linux/workqueue.h: INIT_WORK arch/um/drivers/port_kern.c:139: need linux/workqueue.h: DECLARE_WORK arch/um/include/chan_kern.h:26: need linux/workqueue.h: struct work_struct arch/x86_64/kernel/mce.c:239: need linux/workqueue.h: DECLARE_WORK drivers/atm/ambassador.c:2244: need linux/workqueue.h: INIT_WORK drivers/atm/ambassador.h:635: need linux/workqueue.h: struct work_struct drivers/atm/idt77252.c:3704: need linux/workqueue.h: INIT_WORK drivers/base/firmware_class.c:477: need linux/workqueue.h: struct work_struct drivers/block/as-iosched.c:124: need linux/workqueue.h: struct work_struct drivers/block/ll_rw_blk.c:250: need linux/workqueue.h: INIT_WORK drivers/char/drm/drm_irq.h:131: need linux/workqueue.h: INIT_WORK drivers/char/cyclades.c:5503: need linux/workqueue.h: INIT_WORK drivers/char/epca.c:1934: need linux/workqueue.h: INIT_WORK drivers/char/epca.h:140: need linux/workqueue.h: struct work_struct drivers/char/esp.c:2547: need linux/workqueue.h: INIT_WORK drivers/char/ip2main.c:933: need linux/workqueue.h: INIT_WORK drivers/char/isicom.c:1779: need linux/workqueue.h: INIT_WORK drivers/char/istallion.c:3333: need linux/workqueue.h: INIT_WORK drivers/char/moxa.c:159: need linux/workqueue.h: struct work_struct drivers/char/mxser.c:270: need linux/workqueue.h: struct work_struct drivers/char/pcxx.c:1447: need linux/workqueue.h: INIT_WORK drivers/char/pcxx.h:91: need linux/workqueue.h: struct work_struct drivers/char/riscom8.c:1711: need linux/workqueue.h: INIT_WORK drivers/char/riscom8.h:84: need linux/workqueue.h: struct work_struct drivers/char/specialix.c:2132: need linux/workqueue.h: INIT_WORK drivers/char/specialix_io8.h:123: need linux/workqueue.h: struct work_struct drivers/char/stallion.c:2296: need linux/workqueue.h: INIT_WORK drivers/char/tty_io.c:1288: need linux/workqueue.h: cancel_delayed_work drivers/char/ip2/i2ellis.h:404: need linux/workqueue.h: struct work_struct drivers/char/ip2/i2lib.c:334: need linux/workqueue.h: INIT_WORK drivers/cpufreq/cpufreq.c:394: need linux/workqueue.h: INIT_WORK drivers/ieee1394/hosts.c:140: need linux/workqueue.h: INIT_WORK drivers/ieee1394/hosts.h:69: need linux/workqueue.h: struct work_struct drivers/input/power.c:52: need linux/workqueue.h: DECLARE_WORK drivers/input/keyboard/atkbd.c:28: linux/workqueue.h not needed. drivers/isdn/act2000/module.c:582: need linux/workqueue.h: INIT_WORK drivers/isdn/hardware/eicon/divasmain.c:21: linux/workqueue.h not needed. drivers/isdn/hisax/amd7930_fn.c:792: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/hfc_2bds0.c:1081: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/hfc_pci.c:1724: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/hfc_sx.c:1504: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/hisax.h:458: need linux/workqueue.h: struct work_struct drivers/isdn/hisax/icc.c:681: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/ipacx.c:998: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/isac.c:680: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/isar.c:1581: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/isdnl1.c:364: need linux/workqueue.h: INIT_WORK drivers/isdn/hisax/w6692.c:1078: need linux/workqueue.h: INIT_WORK drivers/isdn/hysdn/boardergo.c:451: need linux/workqueue.h: INIT_WORK drivers/isdn/i4l/isdn_net.c:2602: need linux/workqueue.h: INIT_WORK drivers/isdn/pcbit/drv.c:132: need linux/workqueue.h: INIT_WORK drivers/isdn/pcbit/layer2.c:33: linux/workqueue.h not needed. drivers/isdn/tpam/tpam_main.c:180: need linux/workqueue.h: INIT_WORK drivers/isdn/tpam/tpam_queues.c:16: linux/workqueue.h not needed. drivers/macintosh/adb.c:277: need linux/workqueue.h: DECLARE_WORK drivers/macintosh/macserial.h:163: need linux/workqueue.h: struct work_struct drivers/media/dvb/dvb-core/dvb_net.c:112: need linux/workqueue.h: struct work_struct drivers/media/video/ir-kbd-gpio.c:169: need linux/workqueue.h: struct work_struct drivers/message/fusion/linux_compat.h:192: need linux/workqueue.h: INIT_WORK drivers/message/fusion/mptlan.h:24: linux/workqueue.h not needed. drivers/message/fusion/mptscsih.h:125: linux/workqueue.h not needed. drivers/message/i2o/i2o_core.c:50: linux/workqueue.h not needed. drivers/message/i2o/i2o_lan.h:139: need linux/workqueue.h: struct work_struct drivers/message/i2o/i2o_proc.c:51: linux/workqueue.h not needed. drivers/net/ibmveth.c:558: need linux/workqueue.h: cancel_delayed_work drivers/net/ibmveth.h:118: need linux/workqueue.h: struct work_struct drivers/net/iseries_veth.c:126: need linux/workqueue.h: struct work_struct drivers/net/s2io.h:723: need linux/workqueue.h: struct work_struct drivers/net/sungem.h:963: need linux/workqueue.h: struct work_struct drivers/net/tg3.h:2121: need linux/workqueue.h: struct work_struct drivers/net/tlan.h:211: need linux/workqueue.h: struct work_struct drivers/net/e1000/e1000_main.c:525: need linux/workqueue.h: INIT_WORK drivers/net/ixgb/ixgb.h:151: need linux/workqueue.h: struct work_struct drivers/net/ixgb/ixgb_main.c:405: need linux/workqueue.h: INIT_WORK drivers/net/wan/lmc/lmc_proto.c:37: linux/workqueue.h not needed. drivers/net/wan/pc300_tty.c:107: need linux/workqueue.h: struct work_struct drivers/net/wan/sdla_chdlc.c:161: need linux/workqueue.h: struct work_struct drivers/net/wan/sdla_ppp.c:215: need linux/workqueue.h: struct work_struct drivers/net/wan/sdlamain.c:217: need linux/workqueue.h: DECLARE_WORK drivers/net/wireless/prism54/islpci_dev.c:744: need linux/workqueue.h: INIT_WORK drivers/net/wireless/prism54/islpci_mgt.c:388: need linux/workqueue.h: INIT_WORK drivers/net/wireless/orinoco.c:4163: need linux/workqueue.h: INIT_WORK drivers/pci/hotplug/cpqphp.h:318: need linux/workqueue.h: struct work_struct drivers/pci/hotplug/cpqphp_core.c:39: linux/workqueue.h not needed. drivers/pci/hotplug/cpqphp_ctrl.c:34: linux/workqueue.h not needed. drivers/pci/hotplug/cpqphp_nvram.c:35: linux/workqueue.h not needed. drivers/pci/hotplug/cpqphp_pci.c:34: linux/workqueue.h not needed. drivers/pci/hotplug/cpqphp_sysfs.c:34: linux/workqueue.h not needed. drivers/pci/hotplug/pciehp_core.c:38: linux/workqueue.h not needed. drivers/pci/hotplug/pciehp_ctrl.c:35: linux/workqueue.h not needed. drivers/pci/hotplug/pciehp_pci.c:35: linux/workqueue.h not needed. drivers/pci/hotplug/pciehp_sysfs.c:34: linux/workqueue.h not needed. drivers/pci/hotplug/shpchp_core.c:38: linux/workqueue.h not needed. drivers/pci/hotplug/shpchp_ctrl.c:35: linux/workqueue.h not needed. drivers/pci/hotplug/shpchp_pci.c:35: linux/workqueue.h not needed. drivers/pci/hotplug/shpchp_sysfs.c:34: linux/workqueue.h not needed. drivers/pcmcia/i82092.c:17: linux/workqueue.h not needed. drivers/pcmcia/i82365.c:48: linux/workqueue.h not needed. drivers/pcmcia/tcic.c:46: linux/workqueue.h not needed. drivers/pcmcia/yenta_socket.c:16: linux/workqueue.h not needed. drivers/s390/block/dasd.c:105: need linux/workqueue.h: INIT_WORK drivers/s390/char/ctrlchar.c:27: need linux/workqueue.h: DECLARE_WORK drivers/s390/char/tape_block.c:261: need linux/workqueue.h: INIT_WORK drivers/s390/cio/css.c:312: need linux/workqueue.h: DECLARE_WORK drivers/s390/cio/device_fsm.c:162: need linux/workqueue.h: PREPARE_WORK drivers/s390/cio/qdio.c:1756: need linux/workqueue.h: PREPARE_WORK drivers/s390/net/lcs.c:337: need linux/workqueue.h: INIT_WORK drivers/s390/net/qeth.h:702: need linux/workqueue.h: struct work_struct drivers/s390/scsi/zfcp_erp.c:1733: need linux/workqueue.h: struct work_struct drivers/scsi/NCR5380.c:1004: need linux/workqueue.h: INIT_WORK drivers/scsi/NCR5380.h:276: need linux/workqueue.h: struct work_struct drivers/scsi/ipr.c:5618: need linux/workqueue.h: INIT_WORK drivers/scsi/ipr.h:900: need linux/workqueue.h: struct work_struct drivers/serial/68328serial.c:1484: need linux/workqueue.h: INIT_WORK drivers/serial/68328serial.h:162: need linux/workqueue.h: struct work_struct drivers/serial/68360serial.c:252: need linux/workqueue.h: struct work_struct drivers/serial/mcfserial.c:1722: need linux/workqueue.h: INIT_WORK drivers/serial/mcfserial.h:66: need linux/workqueue.h: struct work_struct drivers/usb/class/bluetty.c:197: need linux/workqueue.h: struct work_struct drivers/usb/class/cdc-acm.c:151: need linux/workqueue.h: struct work_struct drivers/usb/core/hcd.c:1597: need linux/workqueue.h: INIT_WORK drivers/usb/core/hcd.h:70: need linux/workqueue.h: struct work_struct drivers/usb/core/hub.c:499: need linux/workqueue.h: INIT_WORK drivers/usb/host/ohci-mem.c:36: need linux/workqueue.h: INIT_WORK drivers/usb/host/ohci.h:378: need linux/workqueue.h: struct work_struct drivers/usb/gadget/ether.c:117: need linux/workqueue.h: struct work_struct drivers/usb/net/kaweth.c:224: need linux/workqueue.h: struct work_struct drivers/usb/serial/usb-serial.c:1075: need linux/workqueue.h: INIT_WORK drivers/usb/serial/usb-serial.h:112: need linux/workqueue.h: struct work_struct drivers/usb/serial/whiteheat.c:231: need linux/workqueue.h: struct work_struct drivers/video/pxafb.c:1072: need linux/workqueue.h: INIT_WORK drivers/video/pxafb.h:90: need linux/workqueue.h: struct work_struct drivers/video/sa1100fb.c:1723: need linux/workqueue.h: INIT_WORK drivers/video/sa1100fb.h:105: need linux/workqueue.h: struct work_struct drivers/video/console/fbcon.c:587: need linux/workqueue.h: INIT_WORK fs/ncpfs/inode.c:583: need linux/workqueue.h: INIT_WORK fs/nfs/idmap.c:46: linux/workqueue.h not needed. fs/nfs/nfs4renewd.c:90: need linux/workqueue.h: cancel_delayed_work fs/smbfs/sock.c:22: linux/workqueue.h not needed. fs/xfs/linux-2.6/xfs_buf.h:147: need linux/workqueue.h: struct work_struct include/linux/cyclades.h:606: need linux/workqueue.h: struct work_struct include/linux/hayesesp.h:103: need linux/workqueue.h: struct work_struct include/linux/if_wanpipe_common.h:35: need linux/workqueue.h: struct work_struct include/linux/isdn.h:383: need linux/workqueue.h: struct work_struct include/linux/isicom.h:154: need linux/workqueue.h: struct work_struct include/linux/istallion.h:76: need linux/workqueue.h: struct work_struct include/linux/jffs2_fs_sb.h:8: linux/workqueue.h not needed. include/linux/kernelcapi.h:67: need linux/workqueue.h: struct work_struct include/linux/reiserfs_fs.h:19: linux/workqueue.h not needed. include/linux/serial167.h:52: need linux/workqueue.h: struct work_struct include/linux/stallion.h:100: need linux/workqueue.h: struct work_struct include/linux/workqueue.h:5: need linux/workqueue.h: _LINUX_WORKQUEUE_H include/linux/sunrpc/debug.h:15: linux/workqueue.h not needed. include/linux/sunrpc/rpc_pipe_fs.h:33: need linux/workqueue.h: struct work_struct include/linux/sunrpc/types.h:13: linux/workqueue.h not needed. include/linux/sunrpc/xprt.h:173: need linux/workqueue.h: struct work_struct include/net/irda/ircomm_tty.h:103: need linux/workqueue.h: struct work_struct init/main.c:49: linux/workqueue.h not needed.
kernel/kthread.c:123: need linux/workqueue.h: DECLARE_WORK net/bluetooth/hci_sock.c:40: linux/workqueue.h not needed. net/irda/ircomm/ircomm_param.c:32: linux/workqueue.h not needed. net/irda/ircomm/ircomm_tty.c:392: need linux/workqueue.h: INIT_WORK net/sctp/inqueue.c:57: need linux/workqueue.h: INIT_WORK net/sunrpc/auth_gss/auth_gss.c:53: linux/workqueue.h not needed. net/sunrpc/clnt.c:33: linux/workqueue.h not needed. net/sunrpc/sunrpc_syms.c:24: linux/workqueue.h not needed. sound/core/init.c:121: need linux/workqueue.h: INIT_WORK

#10 lore raw

Re: [sched.h 6/8] move aio include to mm.h

Quoted 3 lines · William Lee Irwin III
Quoted 3 lines

This patch moves the aio inclusion from sched.h to mm.h, while leaving workqueue.h directly included by sched.h; a large sweep is required to clean up drivers including workqueue.h indirectly via sched.h

Quoted 3 lines · Arnd Bergmann

FYI: the checkheaders.pl script I recently posted here gives me the following 175 results about potentially incorrect use of workqueue.h.

Grepping by hand turned up 186 files missing potentially missing direct includes of workqueue.h, though I don't have a way to tell if I got false negatives.

-- wli

#11 lore raw

Re: [sched.h 6/8] move aio include to mm.h

Quoted 5 lines · William Lee Irwin III
Quoted 3 lines · William Lee Irwin III
Quoted 3 lines

This patch moves the aio inclusion from sched.h to mm.h, while leaving workqueue.h directly included by sched.h; a large sweep is required to clean up drivers including workqueue.h indirectly via sched.h

Quoted 9 lines
Quoted 3 lines · Arnd Bergmann

FYI: the checkheaders.pl script I recently posted here gives me the following 175 results about potentially incorrect use of workqueue.h.

Grepping by hand turned up 186 files missing potentially missing direct includes of workqueue.h, though I don't have a way to tell if I got false negatives.

Can't you just try to build it with allyesconfig and see what breaks?

Lee

#12 lore raw

Re: [sched.h 6/8] move aio include to mm.h

Quoted 3 lines · William Lee Irwin III
Quoted 3 lines

Grepping by hand turned up 186 files missing potentially missing direct includes of workqueue.h, though I don't have a way to tell if I got false negatives.

Quoted 1 line · Lee Revell

Can't you just try to build it with allyesconfig and see what breaks?

No, architectural ifdefs, not always done directly in drivers, fool that, among other things, e.g. turning an option on can bring in the header under various circumstances.

-- wli

#13 lore raw

Re: [sched.h 6/8] move aio include to mm.h

In reply to William Lee Irwin III
Quoted 4 lines · William Lee Irwin III

Grepping by hand turned up 186 files missing potentially missing direct includes of workqueue.h, though I don't have a way to tell if I got false negatives.

I just realized that I was using an old kernel tree (2.6.7 with some patches), which might be the reason for getting fewer results (38 of my 175 findings were extra #include lines, not missing ones).

Running my script against the linux.bkbits.net tree gives now gives me 178 missing and 35 extraneous inclusions of workqueue.h, so your list is probably exact if you are grepping against -mm.

	Arnd <><