Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] [PATCH] IPVS: logging sizeof(struct ip_vs_conn) on startup

 

 

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded


heder at google

Jul 27, 2009, 2:08 AM

Post #1 of 4 (918 views)
Permalink
[lvs-users] [PATCH] IPVS: logging sizeof(struct ip_vs_conn) on startup

No more guessing, how much memory is used by IPVS for a connection.

Signed-off-by: Hannes Eder <heder [at] google>
---
net/netfilter/ipvs/ip_vs_core.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index b021464..5b0997c 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1475,7 +1475,8 @@ static int __init ip_vs_init(void)
goto cleanup_conn;
}

- IP_VS_INFO("ipvs loaded.\n");
+ IP_VS_INFO("ipvs loaded (using %Zd bytes/connection).\n",
+ sizeof(struct ip_vs_conn));
return ret;

cleanup_conn:


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


horms at verge

Jul 27, 2009, 2:22 AM

Post #2 of 4 (856 views)
Permalink
Re: [lvs-users] [PATCH] IPVS: logging sizeof(struct ip_vs_conn) on startup [In reply to]

On Mon, Jul 27, 2009 at 11:08:34AM +0200, Hannes Eder wrote:
> No more guessing, how much memory is used by IPVS for a connection.

I like that.

> Signed-off-by: Hannes Eder <heder [at] google>

Signed-off-by: Simon Horman <horms [at] verge>

> ---
> net/netfilter/ipvs/ip_vs_core.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index b021464..5b0997c 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1475,7 +1475,8 @@ static int __init ip_vs_init(void)
> goto cleanup_conn;
> }
>
> - IP_VS_INFO("ipvs loaded.\n");
> + IP_VS_INFO("ipvs loaded (using %Zd bytes/connection).\n",
> + sizeof(struct ip_vs_conn));
> return ret;
>
> cleanup_conn:
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo [at] vger
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


eric.dumazet at gmail

Jul 27, 2009, 2:25 AM

Post #3 of 4 (864 views)
Permalink
Re: [lvs-users] [PATCH] IPVS: logging sizeof(struct ip_vs_conn) on startup [In reply to]

Hannes Eder a écrit :
> No more guessing, how much memory is used by IPVS for a connection.
>
> Signed-off-by: Hannes Eder <heder [at] google>
> ---
> net/netfilter/ipvs/ip_vs_core.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index b021464..5b0997c 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1475,7 +1475,8 @@ static int __init ip_vs_init(void)
> goto cleanup_conn;
> }
>
> - IP_VS_INFO("ipvs loaded.\n");
> + IP_VS_INFO("ipvs loaded (using %Zd bytes/connection).\n",
> + sizeof(struct ip_vs_conn));
> return ret;
>
> cleanup_conn:

Well, ip_vs_conn_cache uses SLAB_HWCACHE_ALIGN, so this should be rounded up
to L1 cache size. Or add "at least" like in line 1080
of net/netfilter/ipvs/ip_vs_conn.c :

IP_VS_DBG(0, "Each connection entry needs %Zd bytes at least\n",
sizeof(struct ip_vs_conn));


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


heder at google

Jul 27, 2009, 3:34 AM

Post #4 of 4 (868 views)
Permalink
Re: [lvs-users] [PATCH] IPVS: logging sizeof(struct ip_vs_conn) on startup [In reply to]

On Mon, Jul 27, 2009 at 11:25, Eric Dumazet<eric.dumazet [at] gmail> wrote:
> Well, ip_vs_conn_cache uses SLAB_HWCACHE_ALIGN, so this should be rounded up
> to L1 cache size. Or add "at least" like in line 1080
> of net/netfilter/ipvs/ip_vs_conn.c :
>
> IP_VS_DBG(0, "Each connection entry needs %Zd bytes at least\n",
> sizeof(struct ip_vs_conn));

Good point. Is there an easy way to figure out how much memory is
wasted for alignment by the slab allocator? Otherwise I vote for the
"at least" approach.

-Hannes

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.