Commit 323b0b2c authored by Dmitry Eremin's avatar Dmitry Eremin Committed by Greg Kroah-Hartman
Browse files

staging/lustre/libcfs: Remove redundant enums and sysctl moduleparams



/proc/sys/lnet/lnet_memused
Remove memory tracking for LNet.
Remove redundant enums definition.

Signed-off-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8710427d
Loading
Loading
Loading
Loading
+1 −27
Original line number Diff line number Diff line
@@ -87,24 +87,6 @@ do { \
	lbug_with_loc(&msgdata);					\
} while (0)

extern atomic_t libcfs_kmemory;
/*
 * Memory
 */

# define libcfs_kmem_inc(ptr, size)		\
do {						\
	atomic_add(size, &libcfs_kmemory);	\
} while (0)

# define libcfs_kmem_dec(ptr, size)		\
do {						\
	atomic_sub(size, &libcfs_kmemory);	\
} while (0)

# define libcfs_kmem_read()			\
	atomic_read(&libcfs_kmemory)

#ifndef LIBCFS_VMALLOC_SIZE
#define LIBCFS_VMALLOC_SIZE	(2 << PAGE_CACHE_SHIFT) /* 2 pages */
#endif
@@ -121,13 +103,8 @@ do { \
	if (unlikely((ptr) == NULL)) {					    \
		CERROR("LNET: out of memory at %s:%d (tried to alloc '"	    \
		       #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size));  \
		CERROR("LNET: %d total bytes allocated by lnet\n",	    \
		       libcfs_kmem_read());				    \
	} else {							    \
		memset((ptr), 0, (size));				    \
		libcfs_kmem_inc((ptr), (size));				    \
		CDEBUG(D_MALLOC, "alloc '" #ptr "': %d at %p (tot %d).\n",  \
		       (int)(size), (ptr), libcfs_kmem_read());		    \
	}								    \
} while (0)

@@ -180,9 +157,6 @@ do { \
		       "%s:%d\n", s, __FILE__, __LINE__);	       \
		break;						  \
	}							       \
	libcfs_kmem_dec((ptr), s);				      \
	CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %d).\n",     \
	       s, (ptr), libcfs_kmem_read());				\
	if (unlikely(s > LIBCFS_VMALLOC_SIZE))			  \
		vfree(ptr);				    \
	else							    \
+0 −12
Original line number Diff line number Diff line
@@ -2667,9 +2667,6 @@ static void kiblnd_base_shutdown(void)

	LASSERT(list_empty(&kiblnd_data.kib_devs));

	CDEBUG(D_MALLOC, "before LND base cleanup: kmem %d\n",
	       atomic_read(&libcfs_kmemory));

	switch (kiblnd_data.kib_init) {
	default:
		LBUG();
@@ -2720,9 +2717,6 @@ static void kiblnd_base_shutdown(void)
	if (kiblnd_data.kib_scheds != NULL)
		cfs_percpt_free(kiblnd_data.kib_scheds);

	CDEBUG(D_MALLOC, "after LND base cleanup: kmem %d\n",
	       atomic_read(&libcfs_kmemory));

	kiblnd_data.kib_init = IBLND_INIT_NOTHING;
	module_put(THIS_MODULE);
}
@@ -2739,9 +2733,6 @@ void kiblnd_shutdown(lnet_ni_t *ni)
	if (net == NULL)
		goto out;

	CDEBUG(D_MALLOC, "before LND net cleanup: kmem %d\n",
	       atomic_read(&libcfs_kmemory));

	write_lock_irqsave(g_lock, flags);
	net->ibn_shutdown = 1;
	write_unlock_irqrestore(g_lock, flags);
@@ -2786,9 +2777,6 @@ void kiblnd_shutdown(lnet_ni_t *ni)
		break;
	}

	CDEBUG(D_MALLOC, "after LND net cleanup: kmem %d\n",
	       atomic_read(&libcfs_kmemory));

	net->ibn_init = IBLND_INIT_NOTHING;
	ni->ni_data = NULL;

+0 −5
Original line number Diff line number Diff line
@@ -2252,8 +2252,6 @@ ksocknal_base_shutdown(void)
	int i;
	int j;

	CDEBUG(D_MALLOC, "before NAL cleanup: kmem %d\n",
	       atomic_read(&libcfs_kmemory));
	LASSERT(ksocknal_data.ksnd_nnets == 0);

	switch (ksocknal_data.ksnd_init) {
@@ -2331,9 +2329,6 @@ ksocknal_base_shutdown(void)
		break;
	}

	CDEBUG(D_MALLOC, "after NAL cleanup: kmem %d\n",
	       atomic_read(&libcfs_kmemory));

	module_put(THIS_MODULE);
}

+1 −2
Original line number Diff line number Diff line
@@ -526,8 +526,7 @@ ksocknal_process_transmit (ksock_conn_t *conn, ksock_tx_t *tx)

		counter++;   /* exponential backoff warnings */
		if ((counter & (-counter)) == counter)
			CWARN("%u ENOMEM tx %p (%u allocated)\n",
			      counter, conn, atomic_read(&libcfs_kmemory));
			CWARN("%u ENOMEM tx %p\n", counter, conn);

		/* Queue on ksnd_enomem_conns for retry after a timeout */
		spin_lock_bh(&ksocknal_data.ksnd_reaper_lock);
+0 −11
Original line number Diff line number Diff line
@@ -32,17 +32,6 @@

static struct ctl_table_header *lnet_table_header;

#define CTL_LNET	 (0x100)
enum {
	PSDEV_LNET_STATS = 100,
	PSDEV_LNET_ROUTES,
	PSDEV_LNET_ROUTERS,
	PSDEV_LNET_PEERS,
	PSDEV_LNET_BUFFERS,
	PSDEV_LNET_NIS,
	PSDEV_LNET_PTL_ROTOR,
};

#define LNET_LOFFT_BITS		(sizeof(loff_t) * 8)
/*
 * NB: max allowed LNET_CPT_BITS is 8 on 64-bit system and 2 on 32-bit system
Loading