All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/4] bonding: Handle notifications during work-queue processing gracefully
@ 2015-03-21  5:39 Mahesh Bandewar
  2015-03-22 17:53 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Mahesh Bandewar @ 2015-03-21  5:39 UTC (permalink / raw)
  To: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller
  Cc: Mahesh Bandewar, Maciej Zenczykowski, netdev, Eric Dumazet

RTNL is required for sending notifications and if rtnl can not be
acquired, current code skips sending notification. This is especially
bad if the monitoring values selected are large.

This patch adds a bitmask and uses a bit per such work-queue and attempts
to reschedule the work (aggressively) until notifications are sent out and
then resumes the regular cycle.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 include/net/bonding.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/net/bonding.h b/include/net/bonding.h
index 0ac45b4f7f2a..fede3ab4bbcf 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -239,6 +239,7 @@ struct bonding {
 	struct   delayed_work ad_work;
 	struct   delayed_work mcast_work;
 	struct   delayed_work slave_arr_work;
+	unsigned long notif_work_mask;
 #ifdef CONFIG_DEBUG_FS
 	/* debugging support via debugfs */
 	struct	 dentry *debug_dir;
@@ -259,6 +260,24 @@ struct bond_vlan_tag {
 	unsigned short	vlan_id;
 };
 
+typedef enum {
+	BOND_MII_NOTIF = 0,
+	BOND_ARP_NOTIF,
+	BOND_AD_NOTIF,
+} bond_notif_pending_t;
+
+static inline bool bond_get_notif_pending(struct bonding *bond,
+					  bond_notif_pending_t bit)
+{
+	return !!test_and_clear_bit(bit, &bond->notif_work_mask);
+}
+
+static inline void bond_set_notif_pending(struct bonding *bond,
+					  bond_notif_pending_t bit)
+{
+		set_bit(bit, &bond->notif_work_mask);
+}
+
 /**
  * Returns NULL if the net_device does not belong to any of the bond's slaves
  *
-- 
2.2.0.rc0.207.ga3a616c

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v2 1/4] bonding: Handle notifications during work-queue processing gracefully
  2015-03-21  5:39 [PATCH net-next v2 1/4] bonding: Handle notifications during work-queue processing gracefully Mahesh Bandewar
@ 2015-03-22 17:53 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2015-03-22 17:53 UTC (permalink / raw)
  To: Mahesh Bandewar, Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller
  Cc: Maciej Zenczykowski, netdev, Eric Dumazet

Hello.

On 3/21/2015 8:39 AM, Mahesh Bandewar wrote:

> RTNL is required for sending notifications and if rtnl can not be
> acquired, current code skips sending notification. This is especially
> bad if the monitoring values selected are large.

> This patch adds a bitmask and uses a bit per such work-queue and attempts
> to reschedule the work (aggressively) until notifications are sent out and
> then resumes the regular cycle.

> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
>   include/net/bonding.h | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)

> diff --git a/include/net/bonding.h b/include/net/bonding.h
> index 0ac45b4f7f2a..fede3ab4bbcf 100644
> --- a/include/net/bonding.h
> +++ b/include/net/bonding.h
[...]
> @@ -259,6 +260,24 @@ struct bond_vlan_tag {
>   	unsigned short	vlan_id;
>   };
>
> +typedef enum {
> +	BOND_MII_NOTIF = 0,
> +	BOND_ARP_NOTIF,
> +	BOND_AD_NOTIF,
> +} bond_notif_pending_t;
> +
> +static inline bool bond_get_notif_pending(struct bonding *bond,
> +					  bond_notif_pending_t bit)
> +{
> +	return !!test_and_clear_bit(bit, &bond->notif_work_mask);
> +}
> +
> +static inline void bond_set_notif_pending(struct bonding *bond,
> +					  bond_notif_pending_t bit)
> +{
> +		set_bit(bit, &bond->notif_work_mask);

    One tab to many here. :-)

> +}
> +
>   /**
>    * Returns NULL if the net_device does not belong to any of the bond's slaves
>    *

WBR, Sergei

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-22 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21  5:39 [PATCH net-next v2 1/4] bonding: Handle notifications during work-queue processing gracefully Mahesh Bandewar
2015-03-22 17:53 ` Sergei Shtylyov

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.