Ying Xue | 15 Jun 2012 05:17
Favicon

[PATCH] tipc: optimize initialization of network device notifier

Change the initialization of network device notifier from dynamic way
to static way, possibly resulting in a better performance for the
initialization of Ethernet bearer.

Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
---
 net/tipc/eth_media.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index cafb51f..aa61a50 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
 <at>  <at>  -58,7 +58,6  <at>  <at>  struct eth_bearer {
 static const struct tipc_media eth_media_info;
 static struct eth_bearer eth_bearers[MAX_ETH_BEARERS];
 static int eth_started;
-static struct notifier_block notifier;

 /**
  * eth_media_addr_set - initialize Ethernet media address structure
 <at>  <at>  -340,6 +339,14  <at>  <at>  static const struct tipc_media eth_media_info = {
 	.name		= "eth"
 };

+/*
+ * Network device notifier info
+ */
+static struct notifier_block notifier = {
+	.notifier_call	= recv_notification,
(Continue reading)

Erik Hugne | 19 Jun 2012 10:01
Picon
Favicon
Gravatar

Re: [PATCH] tipc: optimize initialization of network device notifier

Hi Ying.
Performance in this context is not really relevant,
maybe you can rephrase the commit message to something like:

Ethernet media initalization is done only when
TIPC is started/switched to network mode.
The initialization of the network device notifier
structure should be moved out of this function
and done statically instead.

//E

On 2012-06-15 05:17, Ying Xue wrote:
> Change the initialization of network device notifier from dynamic way
> to static way, possibly resulting in a better performance for the
> initialization of Ethernet bearer.
>
> Signed-off-by: Ying Xue<ying.xue <at> windriver.com>
> ---
>   net/tipc/eth_media.c |   11 ++++++++---
>   1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
> index cafb51f..aa61a50 100644
> --- a/net/tipc/eth_media.c
> +++ b/net/tipc/eth_media.c
>  <at>  <at>  -58,7 +58,6  <at>  <at>  struct eth_bearer {
>   static const struct tipc_media eth_media_info;
>   static struct eth_bearer eth_bearers[MAX_ETH_BEARERS];
>   static int eth_started;
(Continue reading)

Ying Xue | 19 Jun 2012 10:11
Favicon

Re: [PATCH] tipc: optimize initialization of network device notifier

Erik Hugne wrote:
> Hi Ying.
> Performance in this context is not really relevant,
> maybe you can rephrase the commit message to something like:
>
> Ethernet media initalization is done only when
> TIPC is started/switched to network mode.
> The initialization of the network device notifier
> structure should be moved out of this function
> and done statically instead.
>
Well, your explanation seems more reasonable than mine, thanks Eric :-)

> //E
>
> On 2012-06-15 05:17, Ying Xue wrote:
>> Change the initialization of network device notifier from dynamic way
>> to static way, possibly resulting in a better performance for the
>> initialization of Ethernet bearer.
>>
>> Signed-off-by: Ying Xue<ying.xue <at> windriver.com>
>> ---
>>   net/tipc/eth_media.c |   11 ++++++++---
>>   1 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
>> index cafb51f..aa61a50 100644
>> --- a/net/tipc/eth_media.c
>> +++ b/net/tipc/eth_media.c
>>  <at>  <at>  -58,7 +58,6  <at>  <at>  struct eth_bearer {
(Continue reading)

Paul Gortmaker | 21 Jun 2012 23:05
Favicon

Re: [PATCH] tipc: optimize initialization of network device notifier

On 12-06-14 11:17 PM, Ying Xue wrote:
> Change the initialization of network device notifier from dynamic way
> to static way, possibly resulting in a better performance for the
> initialization of Ethernet bearer.
> 
> Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
> ---
>  net/tipc/eth_media.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
> index cafb51f..aa61a50 100644
> --- a/net/tipc/eth_media.c
> +++ b/net/tipc/eth_media.c
>  <at>  <at>  -58,7 +58,6  <at>  <at>  struct eth_bearer {
>  static const struct tipc_media eth_media_info;
>  static struct eth_bearer eth_bearers[MAX_ETH_BEARERS];
>  static int eth_started;
> -static struct notifier_block notifier;

Please leave the declaration located here in the file, vs. having
it some 300 lines later.

Thanks,
Paul.
--

>  
>  /**
>   * eth_media_addr_set - initialize Ethernet media address structure
(Continue reading)

Ying Xue | 25 Jun 2012 07:37
Favicon

Re: [PATCH] tipc: optimize initialization of network device notifier

Paul Gortmaker wrote:
> On 12-06-14 11:17 PM, Ying Xue wrote:
>   
>> Change the initialization of network device notifier from dynamic way
>> to static way, possibly resulting in a better performance for the
>> initialization of Ethernet bearer.
>>
>> Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
>> ---
>>  net/tipc/eth_media.c |   11 ++++++++---
>>  1 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
>> index cafb51f..aa61a50 100644
>> --- a/net/tipc/eth_media.c
>> +++ b/net/tipc/eth_media.c
>>  <at>  <at>  -58,7 +58,6  <at>  <at>  struct eth_bearer {
>>  static const struct tipc_media eth_media_info;
>>  static struct eth_bearer eth_bearers[MAX_ETH_BEARERS];
>>  static int eth_started;
>> -static struct notifier_block notifier;
>>     
>
> Please leave the declaration located here in the file, vs. having
> it some 300 lines later.
>
>   
Thanks Paul, I will correct it in next version.

Ying
(Continue reading)


Gmane