[Devel] [PATCH rh7 1/5] ub: zap unused socket accounting bits

Vladimir Davydov vdavydov at parallels.com
Mon Aug 31 02:17:36 PDT 2015


It should have been done in the scope of c73bfca7594c ("bc: Rip old
network buffers and sockets accounting").

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 include/bc/beancounter.h | 24 ------------------------
 kernel/bc/beancounter.c  |  8 --------
 2 files changed, 32 deletions(-)

diff --git a/include/bc/beancounter.h b/include/bc/beancounter.h
index d88f9e690a60..a4131e11c15c 100644
--- a/include/bc/beancounter.h
+++ b/include/bc/beancounter.h
@@ -49,26 +49,11 @@
  */
 
 struct task_beancounter;
-struct sock_beancounter;
 
 struct page_private {
 	unsigned long		ubp_tmpfs_respages;
 };
 
-struct sock_private {
-	unsigned long		ubp_rmem_thres;
-	unsigned long		ubp_wmem_pressure;
-	unsigned long		ubp_maxadvmss;
-	unsigned long		ubp_rmem_pressure;
-	int			ubp_tw_count;
-#define UB_RMEM_EXPAND          0
-#define UB_RMEM_KEEP            1
-#define UB_RMEM_SHRINK          2
-	struct list_head	ubp_other_socks;
-	struct list_head	ubp_tcp_socks;
-	struct percpu_counter	ubp_orphan_count;
-};
-
 struct ub_percpu_struct {
 	int dirty_pages;
 	int writeback_pages;
@@ -129,15 +114,6 @@ struct user_beancounter {
 
 	struct page_private	ppriv;
 #define ub_tmpfs_respages	ppriv.ubp_tmpfs_respages
-	struct sock_private	spriv;
-#define ub_rmem_thres		spriv.ubp_rmem_thres
-#define ub_maxadvmss		spriv.ubp_maxadvmss
-#define ub_rmem_pressure	spriv.ubp_rmem_pressure
-#define ub_wmem_pressure	spriv.ubp_wmem_pressure
-#define ub_tcp_sk_list		spriv.ubp_tcp_socks
-#define ub_other_sk_list	spriv.ubp_other_socks
-#define ub_orphan_count		spriv.ubp_orphan_count
-#define ub_tw_count		spriv.ubp_tw_count
 
 	atomic_long_t		dirty_pages;
 	atomic_long_t		writeback_pages;
diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index 35cd80572623..71d2aa5527cd 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -376,9 +376,6 @@ static struct user_beancounter *alloc_ub(const char *name)
 	if (!new_ub->ub_name)
 		goto fail_name;
 
-	if (percpu_counter_init(&new_ub->ub_orphan_count, 0))
-		goto fail_pcpu;
-
 	new_ub->ub_percpu = alloc_percpu(struct ub_percpu_struct);
 	if (new_ub->ub_percpu == NULL)
 		goto fail_free;
@@ -386,8 +383,6 @@ static struct user_beancounter *alloc_ub(const char *name)
 	return new_ub;
 
 fail_free:
-	percpu_counter_destroy(&new_ub->ub_orphan_count);
-fail_pcpu:
 	kfree(new_ub->ub_name);
 fail_name:
 	kfree(new_ub);
@@ -396,7 +391,6 @@ fail_name:
 
 static inline void free_ub(struct user_beancounter *ub)
 {
-	percpu_counter_destroy(&ub->ub_orphan_count);
 	free_percpu(ub->ub_percpu);
 	kfree(ub->ub_store);
 	kfree(ub->private_data2);
@@ -1097,8 +1091,6 @@ static void init_beancounter_struct(struct user_beancounter *ub)
 {
 	ub->ub_magic = UB_MAGIC;
 	spin_lock_init(&ub->ub_lock);
-	INIT_LIST_HEAD(&ub->ub_tcp_sk_list);
-	INIT_LIST_HEAD(&ub->ub_other_sk_list);
 }
 
 static void init_beancounter_nolimits(struct user_beancounter *ub)
-- 
2.1.4




More information about the Devel mailing list