Skip to contentSkip to conversation

Altix I/O code cleanup

PATCH In review Patrick Gefre 8 participants 14 messages Oct 10, 2003 – Oct 17, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Altix I/O code cleanup

This is my first patch for this - more to come ....

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1272 -> 1.1273
# include/asm-ia64/sn/pci/pcibr_private.h 1.10 -> 1.11
# arch/ia64/sn/io/sn2/ml_iograph.c 1.5 -> 1.6
# arch/ia64/sn/io/sn2/xtalk.c 1.2 -> 1.3
# include/asm-ia64/sn/sgi.h 1.7 -> 1.8
# arch/ia64/sn/io/sn2/klconflib.c 1.3 -> 1.4
# include/asm-ia64/sn/arc/hinv.h 1.4 -> (deleted)
# arch/ia64/sn/io/machvec/pci.c 1.11 -> 1.12
# arch/ia64/sn/io/machvec/pci_dma.c 1.16 -> 1.17
# include/asm-ia64/sn/klconfig.h 1.6 -> 1.7
# arch/ia64/sn/io/io.c 1.8 -> 1.9
# arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c 1.9 -> 1.10
# arch/ia64/sn/io/platform_init/irix_io_init.c 1.2 -> 1.3
# arch/ia64/sn/io/sgi_if.c 1.6 -> 1.7
# arch/ia64/sn/io/sn2/shub_intr.c 1.4 -> 1.5
# include/asm-ia64/sn/ioerror_handling.h 1.5 -> 1.6
# arch/ia64/sn/io/sn2/shub.c 1.6 -> 1.7
# arch/ia64/sn/io/hwgfs/hcl.c 1.7 -> 1.8
# arch/ia64/sn/io/hwgfs/labelcl.c 1.1 -> 1.2
# arch/ia64/sn/io/sn2/geo_op.c 1.1 -> 1.2
# arch/ia64/sn/io/sn2/klgraph.c 1.3 -> 1.4
# arch/ia64/sn/io/drivers/ioconfig_bus.c 1.6 -> 1.7
# arch/ia64/sn/io/sn2/bte_error.c 1.3 -> 1.4
# arch/ia64/sn/io/machvec/pci_bus_cvlink.c 1.13 -> 1.14
# include/asm-ia64/sn/arc/types.h 1.5 -> (deleted)
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/10 [email protected] 1.1273
# Some general code clean up - nothing very interesting
# --------------------------------------------
#

arch/ia64/sn/io/drivers/ioconfig_bus.c +0 -1
diff -Nru a/arch/ia64/sn/io/drivers/ioconfig_bus.c b/arch/ia64/sn/io/drivers/ioconfig_bus.c
@@ -19,7 +19,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_sal.h>
arch/ia64/sn/io/hwgfs/hcl.c +0 -76

100 lines not on this page · raw message

arch/ia64/sn/io/hwgfs/labelcl.c +0 -1
diff -Nru a/arch/ia64/sn/io/hwgfs/labelcl.c b/arch/ia64/sn/io/hwgfs/labelcl.c
@@ -16,7 +16,6 @@
 #include <linux/smp_lock.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/hwgfs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 
arch/ia64/sn/io/io.c +0 -3
diff -Nru a/arch/ia64/sn/io/io.c b/arch/ia64/sn/io/io.c
@@ -20,7 +20,6 @@
 #include <asm/sn/io.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/intr.h>
@@ -29,7 +28,6 @@
 #include <asm/sn/sn_cpuid.h>
 
 extern xtalk_provider_t hub_provider;
-extern void hub_intr_init(vertex_hdl_t hubv);
 
 static int force_fire_and_forget = 1;
 static int ignore_conveyor_override;
@@ -601,7 +599,6 @@
 hub_provider_startup(vertex_hdl_t hubv)
 {
 	hub_pio_init(hubv);
-	hub_intr_init(hubv);
 }
 
 /*
arch/ia64/sn/io/machvec/pci.c +0 -1
diff -Nru a/arch/ia64/sn/io/machvec/pci.c b/arch/ia64/sn/io/machvec/pci.c
@@ -22,7 +22,6 @@
 #include <asm/sn/xtalk/xwidget.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/pci/pciio.h>
arch/ia64/sn/io/machvec/pci_bus_cvlink.c +2 -3
diff -Nru a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
@@ -23,7 +23,6 @@
 #include <asm/sn/xtalk/xwidget.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/intr.h>
@@ -437,11 +436,11 @@
 #ifdef CONFIG_PROC_FS
 		extern void register_sn_procfs(void);
 #endif
-		extern void irix_io_init(void);
+		extern void sn_io_init(void);
 		extern void sn_init_cpei_timer(void);
 		
 		init_hcl();
-		irix_io_init();
+		sn_io_init();
 		
 		for (cnode = 0; cnode < numnodes; cnode++) {
 			extern void intr_init_vecblk(cnodeid_t);
arch/ia64/sn/io/machvec/pci_dma.c +0 -1
diff -Nru a/arch/ia64/sn/io/machvec/pci_dma.c b/arch/ia64/sn/io/machvec/pci_dma.c
@@ -29,7 +29,6 @@
 #include <asm/sn/types.h>
 #include <asm/sn/alenlist.h>
 #include <asm/sn/pci/pci_bus_cvlink.h>
-#include <asm/sn/nag.h>
 
 /*
  * For ATE allocations
arch/ia64/sn/io/platform_init/irix_io_init.c +2 -9
diff -Nru a/arch/ia64/sn/io/platform_init/irix_io_init.c b/arch/ia64/sn/io/platform_init/irix_io_init.c
@@ -27,13 +27,6 @@
 extern int pci_bus_to_hcl_cvlink(void);
 extern void mlreset(void);
 
-/* #define DEBUG_IO_INIT 1 */
-#ifdef DEBUG_IO_INIT
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif /* DEBUG_IO_INIT */
-
 /*
  * This routine is responsible for the setup of all the IRIX hwgraph style
  * stuff that's been pulled into linux.  It's called by sn_pci_find_bios which
@@ -45,12 +38,12 @@
  */
 
 void
-irix_io_init(void)
+sn_io_init(void)
 {
 	cnodeid_t cnode;
 
 	/*
-	 * This is the Master CPU.  Emulate mlsetup and main.c in Irix.
+	 * This is the Master CPU.
 	 */
 	mlreset();
 
arch/ia64/sn/io/sgi_if.c +1 -23
diff -Nru a/arch/ia64/sn/io/sgi_if.c b/arch/ia64/sn/io/sgi_if.c
@@ -12,16 +12,14 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <asm/sn/sgi.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
-#include <asm/sn/pci/bridge.h>
 #include <asm/sn/ioerror_handling.h>
 #include <asm/sn/pci/pciio.h>
 #include <asm/sn/slotnum.h>
 
 void *
-snia_kmem_zalloc(size_t size, int flag)
+snia_kmem_zalloc(size_t size)
 {
         void *ptr = kmalloc(size, GFP_KERNEL);
 	if ( ptr )
@@ -34,26 +32,6 @@
 {
         kfree(ptr);
 }
-
-/*
- * the alloc/free_node routines do a simple kmalloc for now ..
- */
-void *
-snia_kmem_alloc_node(register size_t size, register int flags, cnodeid_t node)
-{
-	/* someday will Allocate on node 'node' */
-	return(kmalloc(size, GFP_KERNEL));
-}
-
-void *
-snia_kmem_zalloc_node(register size_t size, register int flags, cnodeid_t node)
-{
-	void *ptr = kmalloc(size, GFP_KERNEL);
-	if ( ptr )
-		BZERO(ptr, size);
-        return(ptr);
-}
-
 
 /*
  * print_register() allows formatted printing of bit fields.  individual
arch/ia64/sn/io/sn2/bte_error.c +0 -1
diff -Nru a/arch/ia64/sn/io/sn2/bte_error.c b/arch/ia64/sn/io/sn2/bte_error.c
@@ -39,7 +39,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/io.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/sn_private.h>
arch/ia64/sn/io/sn2/geo_op.c +0 -1
diff -Nru a/arch/ia64/sn/io/sn2/geo_op.c b/arch/ia64/sn/io/sn2/geo_op.c
@@ -29,7 +29,6 @@
 #include <asm/sn/types.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/iograph.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/labelcl.h>
 #include <asm/sn/io.h>
arch/ia64/sn/io/sn2/klconflib.c +0 -50

74 lines not on this page · raw message

arch/ia64/sn/io/sn2/klgraph.c +1 -3
diff -Nru a/arch/ia64/sn/io/sn2/klgraph.c b/arch/ia64/sn/io/sn2/klgraph.c
@@ -28,13 +28,11 @@
 #include <asm/sn/xtalk/xbow.h>
 #include <asm/sn/hcl_util.h>
 
-// #define KLGRAPH_DEBUG 1
+/* #define KLGRAPH_DEBUG 1 */
 #ifdef KLGRAPH_DEBUG
 #define GRPRINTF(x)	printk x
-#define CE_GRPANIC	CE_PANIC
 #else
 #define GRPRINTF(x)
-#define CE_GRPANIC	CE_PANIC
 #endif
 
 #include <asm/sn/sn_private.h>
arch/ia64/sn/io/sn2/ml_iograph.c +4 -43

96 lines not on this page · raw message

arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c +2 -3
diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c
@@ -319,9 +319,8 @@
     reg_p                        b_respp;
     pcibr_slot_info_resp_t       slotp;
     pcibr_slot_func_info_resp_t  funcp;
-    extern void snia_kmem_free(void *, int);
 
-    slotp = snia_kmem_zalloc(sizeof(*slotp), 0);
+    slotp = snia_kmem_zalloc(sizeof(*slotp));
     if (slotp == NULL) {
         return(ENOMEM);
     }
@@ -395,7 +394,7 @@
         return(EFAULT);
     }
 
-    snia_kmem_free(slotp, sizeof(*slotp));
+    kfree(slotp);
 
     return(0);
 }
arch/ia64/sn/io/sn2/shub.c +1 -1
diff -Nru a/arch/ia64/sn/io/sn2/shub.c b/arch/ia64/sn/io/sn2/shub.c
@@ -203,7 +203,7 @@
         uint64_t        longarg;
 	int		nasid;
 
-        cnode = (cnodeid_t)file->f_dentry->d_fsdata;
+        cnode = (cnodeid_t)(long)file->f_dentry->d_fsdata;
 
         switch (cmd) {
 	case SNDRV_SHUB_CONFIGURE:
arch/ia64/sn/io/sn2/shub_intr.c +1 -8
diff -Nru a/arch/ia64/sn/io/sn2/shub_intr.c b/arch/ia64/sn/io/sn2/shub_intr.c
@@ -18,7 +18,6 @@
 #include <asm/sn/io.h>
 #include <asm/sn/sn_private.h>
 #include <asm/sn/addrs.h>
-#include <asm/sn/invent.h>
 #include <asm/sn/hcl.h>
 #include <asm/sn/hcl_util.h>
 #include <asm/sn/intr.h>
@@ -27,12 +26,6 @@
 #include <asm/sn/sn2/shub_mmr.h>
 #include <asm/sn/sn_cpuid.h>
 
-/* ARGSUSED */
-void
-hub_intr_init(vertex_hdl_t hubv)
-{
-}
-
 xwidgetnum_t
 hub_widget_id(nasid_t nasid)
 {
@@ -77,7 +70,7 @@
 		xtalk_addr = SH_II_INT0 | ((unsigned long)nasid << 36) | (1UL << 47);
 	}
 
-	intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, cnode);
+	intr_hdl = kmalloc(sizeof(struct hub_intr_s), GFP_KERNEL);
 	ASSERT_ALWAYS(intr_hdl);
 
 	xtalk_info = &intr_hdl->i_xtalk_info;
arch/ia64/sn/io/sn2/xtalk.c +0 -5
diff -Nru a/arch/ia64/sn/io/sn2/xtalk.c b/arch/ia64/sn/io/sn2/xtalk.c
@@ -912,11 +912,6 @@
     if (!(widget_info = xwidget_info_get(widget)))
 	return(1);
 
-    /* Remove the inventory information associated
-     * with the widget.
-     */
-    hwgraph_inventory_remove(widget, -1, -1, -1, -1, -1);
-    
     hwid = &(widget_info->w_hwid);
 
     /* Clean out the xwidget information */
include/asm-ia64/sn/arc/hinv.h deleted +0 -183

183 lines not on this page · raw message

include/asm-ia64/sn/arc/types.h deleted +0 -41

41 lines not on this page · raw message

include/asm-ia64/sn/ioerror_handling.h +1 -1
diff -Nru a/include/asm-ia64/sn/ioerror_handling.h b/include/asm-ia64/sn/ioerror_handling.h
@@ -255,7 +255,7 @@
 	 * one.								 
 	 */								 
 	if (v_error_skip_env_get(v, error_env) != GRAPH_SUCCESS) {	 
-		error_env = snia_kmem_zalloc(sizeof(label_t), KM_NOSLEEP);	 
+		error_env = snia_kmem_zalloc(sizeof(label_t));	 
 		/* Unable to allocate memory for jum buffer. This should 
 		 * be a very rare occurrence.				 
 		 */							 
include/asm-ia64/sn/klconfig.h +4 -5
diff -Nru a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h
@@ -41,7 +41,6 @@
 #include <asm/sn/sgi.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/vector.h>
-#include <asm/sn/arc/hinv.h>
 #include <asm/sn/xtalk/xbow.h>
 #include <asm/sn/xtalk/xtalk.h>
 #include <asm/sn/kldir.h>
@@ -514,11 +513,11 @@
 	unsigned char	widid;	          /* Widget id - if applicable */
 	nasid_t		nasid;            /* node number - from parent */
 	char		pad1;		  /* pad out structure. */
-	char		pad2;		  /* pad out structure. */
-	COMPONENT	*arcs_compt;      /* ptr to the arcs struct for ease*/
+	char		pad2;
+	void		*pad3;
         klconf_off_t	errinfo;          /* component specific errors */
-        unsigned short  pad3;             /* pci fields have moved over to */
-        unsigned short  pad4;             /* klbri_t */
+        unsigned short  pad4;
+        unsigned short  pad5;
 } klinfo_t ;
 
 #define KLCONFIG_INFO_ENABLED(_i)	((_i)->flags & KLINFO_ENABLE)
include/asm-ia64/sn/pci/pcibr_private.h +2 -2
diff -Nru a/include/asm-ia64/sn/pci/pcibr_private.h b/include/asm-ia64/sn/pci/pcibr_private.h
@@ -662,8 +662,8 @@
 /*
  * mem alloc/free macros
  */
-#define NEWAf(ptr,n,f)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), (f&PCIIO_NOSLEEP)?KM_NOSLEEP:KM_SLEEP))
-#define NEWA(ptr,n)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), KM_SLEEP))
+#define NEWAf(ptr,n,f)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr))))
+#define NEWA(ptr,n)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr))))
 #define DELA(ptr,n)	(kfree(ptr))
 
 #define NEWf(ptr,f)	NEWAf(ptr,1,f)
include/asm-ia64/sn/sgi.h +1 -3
diff -Nru a/include/asm-ia64/sn/sgi.h b/include/asm-ia64/sn/sgi.h
@@ -169,9 +169,7 @@
 #define splhi()  0
 #define splx(s)
 
-extern void * snia_kmem_alloc_node(register size_t, register int, cnodeid_t);
-extern void * snia_kmem_zalloc(size_t, int);
-extern void * snia_kmem_zalloc_node(register size_t, register int, cnodeid_t );
+extern void * snia_kmem_zalloc(size_t);
 extern int is_specified(char *);
 
 #endif /* _ASM_IA64_SN_SGI_H */
#1 lore raw

David, please apply this set of patches from Pat. Btw, any estimate as to when your BK tree will be updated?

Thanks,
Jesse

Quoted 1 line · Patrick Gefre

This is my first patch for this - more to come ....

#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · On Fri, 10 Oct 2003 14:51:53 -0700, [email protected] (Jesse Barnes) said:

Jesse> David, please apply this set of patches from Pat.

Unfortunately, the 2.6 tree is closed for cleanups. I would _like_ to see the patch applied, though. Perhaps you could talk to Andrew and see if you can get an exception?

Jesse> Btw, any estimate as to when your BK tree will be updated?

Just did a short while ago. It's not the final stuff, but getting closer. (I just merged your discontig fixes, btw.)

	--david
#3 lore raw
Quoted 7 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · On Fri, 10 Oct 2003 14:51:53 -0700, [email protected] (Jesse Barnes) said:

Jesse> David, please apply this set of patches from Pat.

Unfortunately, the 2.6 tree is closed for cleanups. I would _like_ to see the patch applied, though. Perhaps you could talk to Andrew and see if you can get an exception?

Ok, I'll talk to Pat. I know that at least part of this is bugfixes.

Quoted 4 lines

Jesse> Btw, any estimate as to when your BK tree will be updated?

Just did a short while ago. It's not the final stuff, but getting closer. (I just merged your discontig fixes, btw.)

Kick ass! I've been waiting for this day! :)

Thanks,
Jesse

#7 lore raw
In reply to Patrick Gefre
Quoted 1 line · Patrick Gefre

This is my first patch for this - more to come ....

It would be nice to give those credits who submitted those patches. And life would be a lot simpler if you wouldn't submit my individual patches instead of putting them into a big one - this gives useful entries in the revision history and allows for easier binary search if something goes wrong.

p.s. the right list for this would probably be [email protected]

arch/ia64/sn/io/sgi_if.c line 24

Quoted 6 lines

void *

arch/ia64/sn/io/sgi_if.c +1 -1
-snia_kmem_zalloc(size_t size, int flag)
+snia_kmem_zalloc(size_t size)
 {
         void *ptr = kmalloc(size, GFP_KERNEL);

passing a gfp_mask down here would make sense..

Quoted 7 lines

- * the alloc/free_node routines do a simple kmalloc for now ..
- */

arch/ia64/sn/io/sgi_if.c +0 -5
-void *
-snia_kmem_alloc_node(register size_t size, register int flags, cnodeid_t node)
-{
-	/* someday will Allocate on node 'node' */
-	return(kmalloc(size, GFP_KERNEL));

arch/ia64/sn/io/sgi_if.c line 55

Quoted 10 lines
arch/ia64/sn/io/sgi_if.c +0 -10
-}
-
-void *
-snia_kmem_zalloc_node(register size_t size, register int flags, cnodeid_t node)
-{
-	void *ptr = kmalloc(size, GFP_KERNEL);
-	if ( ptr )
-		BZERO(ptr, size);
-        return(ptr);
-}

Why do you remove the per-nod wrappers? Unlike the other these actually had some use as preparation for a node-aware kmalloc..

arch/ia64/sn/io/sn2/ml_iograph.c line 60

Quoted 3 lines
arch/ia64/sn/io/sn2/ml_iograph.c +1 -1
 	int rc;
-	extern void * snia_kmem_zalloc(size_t size, int flag);
+	extern void * snia_kmem_zalloc(size_t size);

This is in a header, isn't it?

arch/ia64/sn/io/sn2/ml_iograph.c line 62

Quoted 3 lines
arch/ia64/sn/io/sn2/ml_iograph.c +1 -1
-	xvolinfo = snia_kmem_zalloc(sizeof(struct xswitch_vol_s), GFP_KERNEL);
+	xvolinfo = snia_kmem_zalloc(sizeof(struct xswitch_vol_s));

You still need to handle a NULL return here.

arch/ia64/sn/io/sn2/shub_intr.c line 74

Quoted 4 lines
arch/ia64/sn/io/sn2/shub_intr.c +1 -1
-	intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, cnode);
+	intr_hdl = kmalloc(sizeof(struct hub_intr_s), GFP_KERNEL);
 	ASSERT_ALWAYS(intr_hdl);

NULL return not handled again (and the assert is totally useless)

include/asm-ia64/sn/pci/pcibr_private.h line 667

Quoted 5 lines
include/asm-ia64/sn/pci/pcibr_private.h +2 -2
-#define NEWAf(ptr,n,f)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), (f&PCIIO_NOSLEEP)?KM_NOSLEEP:KM_SLEEP))
-#define NEWA(ptr,n)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), KM_SLEEP))
+#define NEWAf(ptr,n,f)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr))))
+#define NEWA(ptr,n)	(ptr = snia_kmem_zalloc((n)*sizeof (*(ptr))))
 #define DELA(ptr,n)	(kfree(ptr))

What about killing this stupid wrappers while you're at it?
Also PCIIO_NOSLEEP is never set.

#4 lore raw
In reply to David Mosberger
Quoted 7 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · On Fri, 10 Oct 2003 14:51:53 -0700, [email protected] (Jesse Barnes) said:

Jesse> David, please apply this set of patches from Pat.

Unfortunately, the 2.6 tree is closed for cleanups. I would _like_ to see the patch applied, though. Perhaps you could talk to Andrew and see if you can get an exception?

Sounds strange to apply this rule for a particular årchitectured that just managed to compile again on 2.6 and has a huge backlog of cleanups and restructuring now...

#5 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · On Fri, 10 Oct 2003 14:51:53 -0700, [email protected] (Jesse Barnes) said:

Jesse> David, please apply this set of patches from Pat.

Quoted 7 lines
Quoted 3 lines

Unfortunately, the 2.6 tree is closed for cleanups. I would _like_ to see the patch applied, though. Perhaps you could talk to Andrew and see if you can get an exception?

Sounds strange to apply this rule for a particular årchitectured that just managed to compile again on 2.6 and has a huge backlog of cleanups and restructuring now...

Well there are two reasons for discouraging cleanups. The first is of course that they can destabilise things. But the other is that we want as many developers as possible (Hi, Jesse) concentrating on stabilisation.

I hereby introduce the "bugzilla tax". The cost of each cleanup is two fixes for open bugzilla entries.

But if David really wants this change, and ongoing stabilisation work will be based on top of it then yes, it probably should go in after good testing.

#6 lore raw
Quoted 3 lines · Andrew Morton

Well there are two reasons for discouraging cleanups. The first is of course that they can destabilise things. But the other is that we want as many developers as possible (Hi, Jesse) concentrating on stabilisation.

Well, in this case we're talking about merging already existing patches..

#8 lore raw
In reply to Christoph Hellwig
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christoph" == Christoph Hellwig <[email protected]> writes:

Christoph> On Fri, Oct 10, 2003 at 04:49:57PM -0500, Patrick Gefre Christoph> wrote:

Christoph> Why do you remove the per-nod wrappers? Unlike the other Christoph> these actually had some use as preparation for a node-aware Christoph> kmalloc..

I believe it was me who nuked it, until we start using it properly I don't see any reason for keeping it as a placeholder.

Quoted 3 lines
Quoted 3 lines

- intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s),
KM_NOSLEEP, cnode); + intr_hdl = kmalloc(sizeof(struct hub_intr_s), GFP_KERNEL); ASSERT_ALWAYS(intr_hdl);

Christoph> NULL return not handled again (and the assert is totally Christoph> useless)

ASSERT_ALWAYS checks it, it may not be pretty but it does check it.

Quoted 6 lines
Quoted 6 lines

-#define NEWAf(ptr,n,f) (ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), (f&PCIIO_NOSLEEP)?KM_NOSLEEP:KM_SLEEP)) -#define NEWA(ptr,n) (ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), KM_SLEEP)) +#define NEWAf(ptr,n,f) (ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)))) +#define NEWA(ptr,n) (ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)))) #define DELA(ptr,n) (kfree(ptr))

Christoph> What about killing this stupid wrappers while you're at it? Christoph> Also PCIIO_NOSLEEP is never set.

All the NEWA stuff is going, I sent Pat a patch for it already, it's going away.

Cheers,
Jes

#9 lore raw
Quoted 4 lines · Jes Sorensen

Christoph> NULL return not handled again (and the assert is totally Christoph> useless)

ASSERT_ALWAYS checks it, it may not be pretty but it does check it.

No, it's useless. It's not different at all from just derefencing a NULL pointer - both get you an oops.

#10 lore raw
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christoph" == Christoph Hellwig <[email protected]> writes:

ASSERT_ALWAYS checks it, it may not be pretty but it does check
it.

Christoph> No, it's useless. It's not different at all from just Christoph> derefencing a NULL pointer - both get you an oops.

I haven't looked at the place right there, however if the intention is to panic() on a failed kmalloc because the data structure is required for a core service, then doing ASSERT_ALWAYS isn't that unreasonable.

Jes

#11 lore raw
Quoted 7 lines · Jes Sorensen
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christoph" == Christoph Hellwig <[email protected]> writes:

ASSERT_ALWAYS checks it, it may not be pretty but it does check
it.

Christoph> No, it's useless. It's not different at all from just Christoph> derefencing a NULL pointer - both get you an oops.

Hi Christoph,

In the pointer case yes.

Quoted 5 lines

I haven't looked at the place right there, however if the intention is to panic() on a failed kmalloc because the data structure is required for a core service, then doing ASSERT_ALWAYS isn't that unreasonable.

ASSERT_ALWAYS is used for many other cases other than just for testing NULL Pointers. Whether you call ASSERT_ALWAYS or call panic with a message or just allow it to oops, a descriptive panic message can save some time.

Thanks.

colin

Quoted 8 lines

Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#12 lore raw
Quoted 7 lines · Colin Ngam
Quoted 2 lines

to panic() on a failed kmalloc because the data structure is required for a core service, then doing ASSERT_ALWAYS isn't that unreasonable.

ASSERT_ALWAYS is used for many other cases other than just for testing NULL Pointers. Whether you call ASSERT_ALWAYS or call panic with a message or just allow it to oops, a descriptive panic message can save some time.

Of course - but that's not that point. You have to handle an out of memory situtation propery because it may happen all the time - you should not panic at all. The ASSERT_ALWAYS just confuses automatic checker tools that help to find such conditions.

#13 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christoph" == Christoph Hellwig <[email protected]> writes:

Christoph> Of course - but that's not that point. You have to handle Christoph> an out of memory situtation propery because it may happen Christoph> all the time - you should not panic at all. The Christoph> ASSERT_ALWAYS just confuses automatic checker tools that Christoph> help to find such conditions.

Again,

Quoted 1 line

From a purely theoretical standpoint as I don't remember the code in

question's situation, this again depends on where in the codepath you hit this. If you don't get your memory for certain key data structures early on, there's really very little you can do but panic().

Jes