Re: [PATCH] Athlon-SMP compiles & runs. inline fns honored.

2001-02-11 Thread Alan Cox

> Ouch.  What about un-inlining in_interrupt() for all SMP cases?  Reduces
> code size just a bit, and function calls aren't very expensive on SMP
> machines IMHO...  (and as a side effect solves this problem...)

Call, conditional branch, call is pretty expensive and thats what most
in_interrupt and small constant memcpy/memset paths are

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] Athlon-SMP compiles runs. inline fns honored.

2001-02-11 Thread Alan Cox

 Ouch.  What about un-inlining in_interrupt() for all SMP cases?  Reduces
 code size just a bit, and function calls aren't very expensive on SMP
 machines IMHO...  (and as a side effect solves this problem...)

Call, conditional branch, call is pretty expensive and thats what most
in_interrupt and small constant memcpy/memset paths are

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] Athlon-SMP compiles & runs. inline fns honored.

2001-02-10 Thread Jeff Garzik

Tom Leete wrote:
> 
> Hi Alan
> 
> I found one way to break the circularity. The association of type and struct
> definitions with interlocking inline functions caused the problem. This
> extracts task_struct from linux/sched.h to its own header,
> linux/task_struct.h. There are a few modifications elsewhere to support
> this. I'm not sure all the changes were necessary, but they are working as I
> write:
[long patch snipped]

Ouch.  What about un-inlining in_interrupt() for all SMP cases?  Reduces
code size just a bit, and function calls aren't very expensive on SMP
machines IMHO...  (and as a side effect solves this problem...)

Jeff


-- 
Jeff Garzik   | "You see, in this world there's two kinds of
Building 1024 |  people, my friend: Those with loaded guns
MandrakeSoft  |  and those who dig. You dig."  --Blondie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] Athlon-SMP compiles & runs. inline fns honored.

2001-02-10 Thread Tom Leete

Manfred Spraul wrote:
> 
> Tom Leete wrote:
> >
> > +
> > +#ifndef _LINUX_MM_H
> > +struct vm_area_struct;
> > +#endif
> > +
> Are the #ifndef's necessary?
> Could you try to remove the #ifndef and always declare the struct? gcc
> shouldn't complain.

Probably not necessary, but that seemed tidier if the struct definition is
available.

> 
> > +
> > +/* Try removing /linux/fs.h in capability.h first
> > +#ifndef _LINUX_CAPABILITY_H
> > +typedef struct bogus_cap_struct {
> > +   __u32 cap;
> > +} kernel_cap_t;
> > +#endif
> > +*/
> > +
> Is is possible to get rid of that one?
> What if somone modifies capability.h?

Yes, that's provisional and is superfluous if 'capability.h:17 #include
' is to be removed. It is commented out in the preliminary
patch. Awaiting comment from the authors.

> 
> --
> Manfred

After critique is in, I'll make a polished final version.

Thanks for the review,
Tom

-- 
The Daemons lurk and are dumb. -- Emerson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] Athlon-SMP compiles & runs. inline fns honored.

2001-02-10 Thread Manfred Spraul

Tom Leete wrote:
> 
> +
> +#ifndef _LINUX_MM_H
> +struct vm_area_struct;
> +#endif
> +
Are the #ifndef's necessary?
Could you try to remove the #ifndef and always declare the struct? gcc
shouldn't complain.

> +
> +/* Try removing /linux/fs.h in capability.h first
> +#ifndef _LINUX_CAPABILITY_H
> +typedef struct bogus_cap_struct {
> +   __u32 cap;
> +} kernel_cap_t;
> +#endif
> +*/
> +
Is is possible to get rid of that one?
What if somone modifies capability.h?

--
Manfred
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[PATCH] Athlon-SMP compiles & runs. inline fns honored.

2001-02-10 Thread Tom Leete

Hi Alan

I found one way to break the circularity. The association of type and struct
definitions with interlocking inline functions caused the problem. This
extracts task_struct from linux/sched.h to its own header,
linux/task_struct.h. There are a few modifications elsewhere to support
this. I'm not sure all the changes were necessary, but they are working as I
write:

$ uname -a
Linux mercury 2.4.1 #3 SMP Sat Feb 10 08:28:39 EST 2001 i686 unknown
$ cat /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 6
model   : 1
model name  : AMD-K7(tm) Processor
stepping: 2
cpu MHz : 704.949
cache size  : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat mmx
syscall mmxext 3dnowext 3dnow
bogomips: 1405.74

I don't have access to a real SMP Athlon box, so I'd appreciate test reports
on the real thing. I expect some polishing will be needed.

Cheers,
Tom

-- 
The Daemons lurk and are dumb. -- Emerson

diff -uNr linux-2.4.1-pristine/include/asm-i386/string.h 
linux/include/asm-i386/string.h
--- linux-2.4.1-pristine/include/asm-i386/string.h  Tue Feb  6 03:55:24 2001
+++ linux/include/asm-i386/string.h Sat Feb 10 08:28:32 2001
@@ -289,10 +289,9 @@
 
 /* All this just for in_interrupt() ... */
 
-#include 
-#include 
+#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 
diff -uNr linux-2.4.1-pristine/include/linux/capability.h 
linux/include/linux/capability.h
--- linux-2.4.1-pristine/include/linux/capability.h Thu Feb  8 23:55:24 2001
+++ linux/include/linux/capability.hSat Feb 10 07:41:19 2001
@@ -14,7 +14,9 @@
 #define _LINUX_CAPABILITY_H
 
 #include 
+/* Try removing -- we'll see if there are parasitic users
 #include 
+*/
 
 /* User-level do most of the mapping between kernel and user
capabilities based on the version tag given by the kernel. The
diff -uNr linux-2.4.1-pristine/include/linux/mm_struct.h 
linux/include/linux/mm_struct.h
--- linux-2.4.1-pristine/include/linux/mm_struct.h  Wed Dec 31 19:00:00 1969
+++ linux/include/linux/mm_struct.h Sat Feb 10 08:02:15 2001
@@ -0,0 +1,47 @@
+#ifndef _LINUX_MM_STRUCT_H
+#define _LINUX_MM_STRUCT_H
+/*
+ *  linux/struct_mm.h
+ *  Extracted from linux/sched.h: 02/09/2001 Tom Leete
+ *  
+ */
+
+#ifdef __KERNEL__
+
+#include 
+#include 
+#include 
+#include 
+
+
+#ifndef _LINUX_MM_H
+struct vm_area_struct;
+#endif
+
+struct mm_struct {
+   struct vm_area_struct * mmap;   /* list of VMAs */
+   struct vm_area_struct * mmap_avl;   /* tree of VMAs */
+   struct vm_area_struct * mmap_cache; /* last find_vma result */
+   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 semaphore mmap_sem;
+   spinlock_t page_table_lock;
+
+   struct list_head mmlist;/* List of all active mm's */
+
+   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;
+   unsigned long def_flags;
+   unsigned long cpu_vm_mask;
+   unsigned long swap_address;
+
+   /* Architecture-specific MM context */
+   mm_context_t context;
+};
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_MM_STRUCT_H */
diff -uNr linux-2.4.1-pristine/include/linux/sched.h linux/include/linux/sched.h
--- linux-2.4.1-pristine/include/linux/sched.h  Thu Feb  8 23:55:24 2001
+++ linux/include/linux/sched.h Sat Feb 10 08:28:32 2001
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -200,30 +201,7 @@
 /* Number of map areas at which the AVL tree is activated. This is arbitrary. */
 #define AVL_MIN_MAP_COUNT  32
 
-struct mm_struct {
-   struct vm_area_struct * mmap;   /* list of VMAs */
-   struct vm_area_struct * mmap_avl;   /* tree of VMAs */
-   struct vm_area_struct * mmap_cache; /* last find_vma result */
-   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 semaphore mmap_sem;
-   spinlock_t page_table_lock;
-
-   struct list_head mmlist;/* List of all active mm's */
-
-   unsigned long start_code, end_code, start_data, end_data;
-   unsigned long start_brk, brk, start_stack;
-   

[PATCH] Athlon-SMP compiles runs. inline fns honored.

2001-02-10 Thread Tom Leete

Hi Alan

I found one way to break the circularity. The association of type and struct
definitions with interlocking inline functions caused the problem. This
extracts task_struct from linux/sched.h to its own header,
linux/task_struct.h. There are a few modifications elsewhere to support
this. I'm not sure all the changes were necessary, but they are working as I
write:

$ uname -a
Linux mercury 2.4.1 #3 SMP Sat Feb 10 08:28:39 EST 2001 i686 unknown
$ cat /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 6
model   : 1
model name  : AMD-K7(tm) Processor
stepping: 2
cpu MHz : 704.949
cache size  : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat mmx
syscall mmxext 3dnowext 3dnow
bogomips: 1405.74

I don't have access to a real SMP Athlon box, so I'd appreciate test reports
on the real thing. I expect some polishing will be needed.

Cheers,
Tom

-- 
The Daemons lurk and are dumb. -- Emerson

diff -uNr linux-2.4.1-pristine/include/asm-i386/string.h 
linux/include/asm-i386/string.h
--- linux-2.4.1-pristine/include/asm-i386/string.h  Tue Feb  6 03:55:24 2001
+++ linux/include/asm-i386/string.h Sat Feb 10 08:28:32 2001
@@ -289,10 +289,9 @@
 
 /* All this just for in_interrupt() ... */
 
-#include asm/system.h
-#include asm/ptrace.h
+#include linux/task_struct.h
+#include asm/current.h
 #include linux/smp.h
-#include linux/spinlock.h
 #include linux/interrupt.h
 #include asm/mmx.h
 
diff -uNr linux-2.4.1-pristine/include/linux/capability.h 
linux/include/linux/capability.h
--- linux-2.4.1-pristine/include/linux/capability.h Thu Feb  8 23:55:24 2001
+++ linux/include/linux/capability.hSat Feb 10 07:41:19 2001
@@ -14,7 +14,9 @@
 #define _LINUX_CAPABILITY_H
 
 #include linux/types.h
+/* Try removing -- we'll see if there are parasitic users
 #include linux/fs.h
+*/
 
 /* User-level do most of the mapping between kernel and user
capabilities based on the version tag given by the kernel. The
diff -uNr linux-2.4.1-pristine/include/linux/mm_struct.h 
linux/include/linux/mm_struct.h
--- linux-2.4.1-pristine/include/linux/mm_struct.h  Wed Dec 31 19:00:00 1969
+++ linux/include/linux/mm_struct.h Sat Feb 10 08:02:15 2001
@@ -0,0 +1,47 @@
+#ifndef _LINUX_MM_STRUCT_H
+#define _LINUX_MM_STRUCT_H
+/*
+ *  linux/struct_mm.h
+ *  Extracted from linux/sched.h: 02/09/2001 Tom Leete
+ *  
+ */
+
+#ifdef __KERNEL__
+
+#include linux/list.h
+#include asm/atomic.h
+#include asm/semaphore.h
+#include asm/spinlock.h
+
+
+#ifndef _LINUX_MM_H
+struct vm_area_struct;
+#endif
+
+struct mm_struct {
+   struct vm_area_struct * mmap;   /* list of VMAs */
+   struct vm_area_struct * mmap_avl;   /* tree of VMAs */
+   struct vm_area_struct * mmap_cache; /* last find_vma result */
+   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 semaphore mmap_sem;
+   spinlock_t page_table_lock;
+
+   struct list_head mmlist;/* List of all active mm's */
+
+   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;
+   unsigned long def_flags;
+   unsigned long cpu_vm_mask;
+   unsigned long swap_address;
+
+   /* Architecture-specific MM context */
+   mm_context_t context;
+};
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_MM_STRUCT_H */
diff -uNr linux-2.4.1-pristine/include/linux/sched.h linux/include/linux/sched.h
--- linux-2.4.1-pristine/include/linux/sched.h  Thu Feb  8 23:55:24 2001
+++ linux/include/linux/sched.h Sat Feb 10 08:28:32 2001
@@ -11,6 +11,7 @@
 #include linux/threads.h
 #include linux/kernel.h
 #include linux/types.h
+#include linux/time.h
 #include linux/times.h
 #include linux/timex.h
 
@@ -200,30 +201,7 @@
 /* Number of map areas at which the AVL tree is activated. This is arbitrary. */
 #define AVL_MIN_MAP_COUNT  32
 
-struct mm_struct {
-   struct vm_area_struct * mmap;   /* list of VMAs */
-   struct vm_area_struct * mmap_avl;   /* tree of VMAs */
-   struct vm_area_struct * mmap_cache; /* last find_vma result */
-   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 

Re: [PATCH] Athlon-SMP compiles runs. inline fns honored.

2001-02-10 Thread Manfred Spraul

Tom Leete wrote:
 
 +
 +#ifndef _LINUX_MM_H
 +struct vm_area_struct;
 +#endif
 +
Are the #ifndef's necessary?
Could you try to remove the #ifndef and always declare the struct? gcc
shouldn't complain.

 +
 +/* Try removing /linux/fs.h in capability.h first
 +#ifndef _LINUX_CAPABILITY_H
 +typedef struct bogus_cap_struct {
 +   __u32 cap;
 +} kernel_cap_t;
 +#endif
 +*/
 +
Is is possible to get rid of that one?
What if somone modifies capability.h?

--
Manfred
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] Athlon-SMP compiles runs. inline fns honored.

2001-02-10 Thread Tom Leete

Manfred Spraul wrote:
 
 Tom Leete wrote:
 
  +
  +#ifndef _LINUX_MM_H
  +struct vm_area_struct;
  +#endif
  +
 Are the #ifndef's necessary?
 Could you try to remove the #ifndef and always declare the struct? gcc
 shouldn't complain.

Probably not necessary, but that seemed tidier if the struct definition is
available.

 
  +
  +/* Try removing /linux/fs.h in capability.h first
  +#ifndef _LINUX_CAPABILITY_H
  +typedef struct bogus_cap_struct {
  +   __u32 cap;
  +} kernel_cap_t;
  +#endif
  +*/
  +
 Is is possible to get rid of that one?
 What if somone modifies capability.h?

Yes, that's provisional and is superfluous if 'capability.h:17 #include
linux/fs.h' is to be removed. It is commented out in the preliminary
patch. Awaiting comment from the authors.

 
 --
 Manfred

After critique is in, I'll make a polished final version.

Thanks for the review,
Tom

-- 
The Daemons lurk and are dumb. -- Emerson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] Athlon-SMP compiles runs. inline fns honored.

2001-02-10 Thread Jeff Garzik

Tom Leete wrote:
 
 Hi Alan
 
 I found one way to break the circularity. The association of type and struct
 definitions with interlocking inline functions caused the problem. This
 extracts task_struct from linux/sched.h to its own header,
 linux/task_struct.h. There are a few modifications elsewhere to support
 this. I'm not sure all the changes were necessary, but they are working as I
 write:
[long patch snipped]

Ouch.  What about un-inlining in_interrupt() for all SMP cases?  Reduces
code size just a bit, and function calls aren't very expensive on SMP
machines IMHO...  (and as a side effect solves this problem...)

Jeff


-- 
Jeff Garzik   | "You see, in this world there's two kinds of
Building 1024 |  people, my friend: Those with loaded guns
MandrakeSoft  |  and those who dig. You dig."  --Blondie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/