From: pbonzini@redhat.com (Paolo Bonzini)
Subject: [ltt-dev] [PATCH 07/10] call_rcu: remove write-only qlen variable
Date: Wed, 8 Jun 2011 10:59:15 +0200 [thread overview]
Message-ID: <1307523558-16960-8-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1307523558-16960-1-git-send-email-pbonzini@redhat.com>
The qlen variable is write-only, we can remove it easily.
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
urcu-call-rcu-impl.h | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h
index 7e6acdd..ca597d0 100644
--- a/urcu-call-rcu-impl.h
+++ b/urcu-call-rcu-impl.h
@@ -47,7 +47,6 @@ struct call_rcu_data {
struct cds_wfq_queue cbs;
unsigned long flags;
int futex;
- unsigned long qlen;
pthread_t tid;
int cpu_affinity;
struct cds_list_head list;
@@ -198,7 +197,6 @@ int set_thread_cpu_affinity(struct call_rcu_data *crdp)
static void *call_rcu_thread(void *arg)
{
- unsigned long cbcount;
struct cds_wfq_node *cbs;
struct cds_wfq_node **cbs_tail;
struct call_rcu_data *crdp = (struct call_rcu_data *)arg;
@@ -218,7 +216,6 @@ static void *call_rcu_thread(void *arg)
cbs_tail = (struct cds_wfq_node **)
uatomic_xchg(&crdp->cbs.tail, &crdp->cbs.head);
synchronize_rcu();
- cbcount = 0;
do {
while (cbs->next == NULL &&
&cbs->next != cbs_tail)
@@ -230,9 +227,7 @@ static void *call_rcu_thread(void *arg)
rhp = (struct rcu_head *)cbs;
cbs = cbs->next;
rhp->func(rhp);
- cbcount++;
} while (cbs != NULL);
- uatomic_sub(&crdp->qlen, cbcount);
}
if (uatomic_read(&crdp->flags) & URCU_CALL_RCU_STOP)
break;
@@ -267,7 +262,6 @@ static void call_rcu_data_init(struct call_rcu_data **crdpp,
}
memset(crdp, '\0', sizeof(*crdp));
cds_wfq_init(&crdp->cbs);
- crdp->qlen = 0;
crdp->futex = 0;
crdp->flags = flags;
cds_list_add(&crdp->list, &call_rcu_data_list);
@@ -519,7 +513,6 @@ void call_rcu(struct rcu_head *head,
head->func = func;
crdp = get_call_rcu_data();
cds_wfq_enqueue(&crdp->cbs, &head->next);
- uatomic_inc(&crdp->qlen);
wake_call_rcu_thread(crdp);
}
@@ -565,8 +558,6 @@ void call_rcu_data_free(struct call_rcu_data *crdp)
cbs_endprev = (struct cds_wfq_node **)
uatomic_xchg(&default_call_rcu_data, cbs_tail);
*cbs_endprev = cbs;
- uatomic_add(&default_call_rcu_data->qlen,
- uatomic_read(&crdp->qlen));
cds_list_del(&crdp->list);
free(crdp);
}
--
1.7.4.4
next prev parent reply other threads:[~2011-06-08 8:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 8:59 [ltt-dev] [PATCH 00/10] call_rcu: futex wakeup and miscellaneous improvements Paolo Bonzini
2011-06-08 8:59 ` [ltt-dev] [PATCH 01/10] urcu-qsbr: fix typo Paolo Bonzini
2011-06-08 22:05 ` Mathieu Desnoyers
2011-06-08 8:59 ` [ltt-dev] [PATCH 02/10] rcutorture: make goflag volatile Paolo Bonzini
2011-06-08 22:09 ` Mathieu Desnoyers
2011-06-08 8:59 ` [ltt-dev] [PATCH 03/10] uatomic: fix typo in x86 compat implementation Paolo Bonzini
2011-06-08 22:10 ` Mathieu Desnoyers
2011-06-08 8:59 ` [ltt-dev] [PATCH 04/10] uatomic: add uatomic_or Paolo Bonzini
2011-06-09 13:28 ` Mathieu Desnoyers
2011-06-08 8:59 ` [ltt-dev] [PATCH 05/10] call_rcu: drop mutex Paolo Bonzini
2011-06-08 8:59 ` [ltt-dev] [PATCH 06/10] uatomic: add uatomic_and Paolo Bonzini
2011-06-09 13:30 ` Mathieu Desnoyers
2011-06-08 8:59 ` Paolo Bonzini [this message]
2011-06-08 22:15 ` [ltt-dev] [PATCH 07/10] call_rcu: remove write-only qlen variable Mathieu Desnoyers
[not found] ` <BLU0-SMTP745CE4EF0C62A2E659C78F96620@phx.gbl>
2011-06-08 22:42 ` Paul E. McKenney
2011-06-08 22:46 ` Mathieu Desnoyers
[not found] ` <BLU0-SMTP1821FB0D3BC6534C4B2B5896620@phx.gbl>
2011-06-08 23:25 ` Paul E. McKenney
2011-06-08 23:30 ` Mathieu Desnoyers
2011-06-08 8:59 ` [ltt-dev] [PATCH 08/10] call_rcu: redo futex implementation Paolo Bonzini
2011-06-08 22:42 ` Mathieu Desnoyers
[not found] ` <BLU0-SMTP66FE311FC9ADF1B74FBB2796620@phx.gbl>
2011-06-09 6:54 ` Paolo Bonzini
2011-06-09 13:24 ` Mathieu Desnoyers
2011-06-09 13:34 ` Mathieu Desnoyers
2011-06-08 8:59 ` [ltt-dev] [PATCH 09/10] call_rcu: factor polling from RT and non-RT cases Paolo Bonzini
2011-06-09 14:06 ` Mathieu Desnoyers
[not found] ` <BLU0-SMTP757CECBC5909B84A8F37BD96650@phx.gbl>
2011-06-09 14:20 ` Paolo Bonzini
2011-06-08 8:59 ` [ltt-dev] [PATCH 10/10] call_rcu: avoid useless futex wakeups Paolo Bonzini
2011-06-09 14:07 ` Mathieu Desnoyers
2011-06-08 9:17 ` [ltt-dev] [PATCH] call_rcu: keep BUSY flag set as long as possible Paolo Bonzini
2011-06-09 14:09 ` Mathieu Desnoyers
[not found] ` <BLU0-SMTP5719D5284785410F8A3E1396650@phx.gbl>
2011-06-09 14:20 ` Paolo Bonzini
2011-06-09 14:43 ` Mathieu Desnoyers
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=1307523558-16960-8-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
/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