All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tom Herbert <therbert@google.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] rfs: Receive Flow Steering
Date: Fri, 02 Apr 2010 09:58:42 +0200	[thread overview]
Message-ID: <1270195122.1936.106.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.DEB.1.00.1004012045560.4252@pokey.mtv.corp.google.com>

Le jeudi 01 avril 2010 à 20:59 -0700, Tom Herbert a écrit :

> +static void rps_dev_flow_table_release_work(struct work_struct *work)
> +{
> +	struct rps_dev_flow_table *table = container_of(work,
> +	    struct rps_dev_flow_table, free_work);
> +
> +	vfree(table);
> +}
> +
> +static void rps_dev_flow_table_release(struct rcu_head *rcu)
> +{
> +	struct rps_dev_flow_table *table = container_of(rcu,
> +	    struct rps_dev_flow_table, rcu);
> +
> +	INIT_WORK(&table->free_work, rps_dev_flow_table_release_work);
> +	schedule_work(&table->free_work);
> +}
> +
> +ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue,
> +				     struct rx_queue_attribute *attr,
> +				     const char *buf, size_t len)
> +{

....

> +	if (old_table)
> +		call_rcu(&old_table->rcu, rps_dev_flow_table_release);
> +
> +	return len;
> +}
> +

Instead of this complex logic (yet fine), you might try :

if (old_table) {
	synchronize_rcu();
	vfree(old_table);
	}

(and remove free_work from struct rps_dev_flow_table)

We dont write this file that often, we can afford the synchronize_rcu()
here...




  parent reply	other threads:[~2010-04-02  7:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  3:59 [PATCH] rfs: Receive Flow Steering Tom Herbert
2010-04-02  5:04 ` Changli Gao
2010-04-02  7:29   ` Eric Dumazet
2010-04-02 10:58     ` Changli Gao
2010-04-02 12:01       ` Eric Dumazet
2010-04-02 13:45         ` Changli Gao
2010-04-02 17:01     ` Rick Jones
     [not found]       ` <g2i65634d661004021045uff7c0e25ge7dfd17929bc9ee9@mail.gmail.com>
2010-04-02 18:25         ` Rick Jones
2010-04-08  1:37           ` Changli Gao
2010-04-02  7:58 ` Eric Dumazet [this message]
2010-04-02  8:35 ` Eric Dumazet
2010-04-02 12:37   ` Eric Dumazet
2010-04-02 16:28     ` Eric Dumazet
2010-04-02 19:43       ` Eric Dumazet

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=1270195122.1936.106.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.