xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Bob Liu <lliubbo@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com,
	JBeulich@suse.com
Subject: [PATCH 03/14] tmem: cleanup: drop unneeded client/pool initialization
Date: Tue, 28 Jan 2014 12:28:22 +0800	[thread overview]
Message-ID: <1390883313-19313-4-git-send-email-bob.liu@oracle.com> (raw)
In-Reply-To: <1390883313-19313-1-git-send-email-bob.liu@oracle.com>

Using xzalloc to alloc client and pool, so some extra initialization are
unneeded.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 xen/common/tmem.c |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 362e774..6ed91b4 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1030,24 +1030,13 @@ static struct tmem_pool * pool_alloc(void)
     struct tmem_pool *pool;
     int i;
 
-    if ( (pool = xmalloc(struct tmem_pool)) == NULL )
+    if ( (pool = xzalloc(struct tmem_pool)) == NULL )
         return NULL;
     for (i = 0; i < OBJ_HASH_BUCKETS; i++)
         pool->obj_rb_root[i] = RB_ROOT;
     INIT_LIST_HEAD(&pool->pool_list);
     INIT_LIST_HEAD(&pool->persistent_page_list);
-    pool->cur_pgp = NULL;
     rwlock_init(&pool->pool_rwlock);
-    pool->pgp_count_max = pool->obj_count_max = 0;
-    pool->objnode_count = pool->objnode_count_max = 0;
-    atomic_set(&pool->pgp_count,0);
-    pool->obj_count = 0; pool->shared_count = 0;
-    pool->good_puts = pool->puts = pool->dup_puts_flushed = 0;
-    pool->dup_puts_replaced = pool->no_mem_puts = 0;
-    pool->found_gets = pool->gets = 0;
-    pool->flushs_found = pool->flushs = 0;
-    pool->flush_objs_found = pool->flush_objs = 0;
-    pool->is_dying = 0;
     return pool;
 }
 
@@ -1216,15 +1205,9 @@ static struct client *client_create(domid_t cli_id)
     for ( i = 0; i < MAX_GLOBAL_SHARED_POOLS; i++)
         client->shared_auth_uuid[i][0] =
             client->shared_auth_uuid[i][1] = -1L;
-    client->frozen = 0; client->live_migrating = 0;
-    client->weight = 0; client->cap = 0;
     list_add_tail(&client->client_list, &global_client_list);
     INIT_LIST_HEAD(&client->ephemeral_page_list);
     INIT_LIST_HEAD(&client->persistent_invalidated_list);
-    client->cur_pgp = NULL;
-    client->eph_count = client->eph_count_max = 0;
-    client->total_cycles = 0; client->succ_pers_puts = 0;
-    client->succ_eph_gets = 0; client->succ_pers_gets = 0;
     tmem_client_info("ok\n");
     return client;
 
-- 
1.7.10.4

  parent reply	other threads:[~2014-01-28  4:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  4:28 [PATCH RESEND 00/14] xen: new patches for tmem Bob Liu
2014-01-28  4:28 ` [PATCH 01/14] tmem: remove pageshift from struct tmem_pool Bob Liu
2014-01-28  4:28 ` [PATCH 02/14] tmem: refactor function do_tmem_op() Bob Liu
2014-01-28  4:28 ` Bob Liu [this message]
2014-01-28  4:28 ` [PATCH 04/14] tmem: bugfix in obj allocate path Bob Liu
2014-01-28  4:28 ` [PATCH 05/14] tmem: cleanup: remove unneed parameter from pgp_delist() Bob Liu
2014-01-28  4:28 ` [PATCH 06/14] tmem: cleanup: remove unneed parameter from pgp_free() Bob Liu
2014-01-28  4:28 ` [PATCH 07/14] tmem: cleanup the pgp free path Bob Liu
2014-01-28  4:28 ` [PATCH 08/14] tmem: drop oneline function client_freeze() Bob Liu
2014-01-28  4:28 ` [PATCH 09/14] tmem: remove unneeded parameters from obj destroy path Bob Liu
2014-01-28  4:28 ` [PATCH 10/14] tmem: cleanup: drop global_pool_list Bob Liu
2014-01-28  4:28 ` [PATCH 11/14] tmem: fix the return value of tmemc_set_var() Bob Liu
2014-01-28  4:28 ` [PATCH 12/14] tmem: cleanup: refactor function tmemc_shared_pool_auth() Bob Liu
2014-01-28  4:28 ` [PATCH 13/14] tmem: reorg the shared pool allocate path Bob Liu
2014-03-05 22:03   ` Konrad Rzeszutek Wilk
2014-01-28  4:28 ` [PATCH 14/14] tmem: remove useless parameter from client and pool flush Bob Liu
2014-03-19 17:04 ` [PATCH RESEND 00/14] xen: new patches for tmem Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2013-12-18  6:52 [PATCH 00/14] xen: new patches for tmem cleanup Bob Liu
2013-12-18  6:52 ` [PATCH 03/14] tmem: cleanup: drop unneeded client/pool initialization Bob Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390883313-19313-4-git-send-email-bob.liu@oracle.com \
    --to=lliubbo@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).