netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Required guidance to debug ipsec memory leak
@ 2019-11-18  6:35 Vakul Garg
  2019-11-18  7:16 ` Steffen Klassert
  0 siblings, 1 reply; 3+ messages in thread
From: Vakul Garg @ 2019-11-18  6:35 UTC (permalink / raw)
  To: netdev

Hi

I need help to debug a suspected memory leak problem while running kernel ipsec with rekeying enabled.
I am using strongswan for tunnel creation/maintainence and using kernel 5.4 (with e1000 ethernet adapters) on cortex-a72 based quadcore cpu.

My setup uses hub-and-spoke model (1 hub and 2-spokes).
In all there are 4 tunnels.

When traffic is running, the kernel shows that 'used' memory (in ''free'' command output) gets incremented steadily.
The system keeps loosing memory and eventually after several hours, OOM killer gets invoked.

The memory usage does not increase if traffic is not run (and simply rekeying is happening).
The memory depletes faster if rekey time is decreased or if number of tunnels in increased.

'Kmemleak' does not show up anything.

I checked that number of states (i.e. net->xfrm.state_num) does not increase much and states are getting freed as expected.

Kindly guide me about what else to check.

Regards

Vakul


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

* Re: Required guidance to debug ipsec memory leak
  2019-11-18  6:35 Required guidance to debug ipsec memory leak Vakul Garg
@ 2019-11-18  7:16 ` Steffen Klassert
  2019-11-25  9:27   ` Vakul Garg
  0 siblings, 1 reply; 3+ messages in thread
From: Steffen Klassert @ 2019-11-18  7:16 UTC (permalink / raw)
  To: Vakul Garg; +Cc: netdev

On Mon, Nov 18, 2019 at 06:35:24AM +0000, Vakul Garg wrote:
> Hi
> 
> I need help to debug a suspected memory leak problem while running kernel ipsec with rekeying enabled.

Did you try with the current net tree? There is a fix for
such a leak:

commit 86c6739eda7d ("xfrm: Fix memleak on xfrm state destroy")


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

* RE: Required guidance to debug ipsec memory leak
  2019-11-18  7:16 ` Steffen Klassert
@ 2019-11-25  9:27   ` Vakul Garg
  0 siblings, 0 replies; 3+ messages in thread
From: Vakul Garg @ 2019-11-25  9:27 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: netdev



> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org>
> On Behalf Of Steffen Klassert
> Sent: Monday, November 18, 2019 12:47 PM
> To: Vakul Garg <vakul.garg@nxp.com>
> Cc: netdev@vger.kernel.org
> Subject: Re: Required guidance to debug ipsec memory leak
> 
> On Mon, Nov 18, 2019 at 06:35:24AM +0000, Vakul Garg wrote:
> > Hi
> >
> > I need help to debug a suspected memory leak problem while running
> kernel ipsec with rekeying enabled.
> 
> Did you try with the current net tree? There is a fix for such a leak:
> 
> commit 86c6739eda7d ("xfrm: Fix memleak on xfrm state destroy")

Sorry for a late response. Thanks for the help. 
The given patch has helped in reducing the rate at which memory is leaking.

But we are still losing memory at rate of about 30-40MB per hour.

Any pointers in debugging would greatly help.

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

end of thread, other threads:[~2019-11-25  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18  6:35 Required guidance to debug ipsec memory leak Vakul Garg
2019-11-18  7:16 ` Steffen Klassert
2019-11-25  9:27   ` Vakul Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).