From owner-freebsd-xen@FreeBSD.ORG Fri Feb 13 16:31:33 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8B945E3; Fri, 13 Feb 2015 16:31:33 +0000 (UTC) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "Cybertrust Public SureServer SV CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E473779F; Fri, 13 Feb 2015 16:31:32 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.09,571,1418083200"; d="scan'208";a="226779481" Received: from [IPv6:::1] (10.80.16.47) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.210.2; Fri, 13 Feb 2015 11:31:24 -0500 Message-ID: <54DE26DB.90000@citrix.com> Date: Fri, 13 Feb 2015 17:31:23 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andrew Thompson Subject: Re: xenstore memory issue References: <54D88BD5.7050703@citrix.com> <54DA303F.9020203@citrix.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-DLP: MIA1 Cc: freebsd-xen@freebsd.org X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 16:31:33 -0000 El 13/02/15 a les 0.46, Andrew Thompson ha escrit: > On 11 February 2015 at 05:22, Roger Pau Monné wrote: > >> Hello Andrew, >> >> El 10/02/15 a les 10.22, Andrew Thompson ha escrit: >>> On 10 February 2015 at 16:25, Andrew Thompson >> wrote: >>> >>>> On 9 February 2015 at 23:28, Roger Pau Monné >> wrote: >>>> A bit of trial and error with dtrace has narrowed this down. I can cause >>>> the leak by just opening /dev/xen/xenstore >> >> Thanks for doing all this legwork! IMHO the best solution is to switch >> xenstore dev to use cdevpriv in order to store each client data. What we >> are doing right now (storing client data in dev->si_dvr1) is plain >> wrong. I've uploaded two patches (one for HEAD and one for stable/10) so >> that you can try it also, please report back whether this fixes your >> problem or not: >> >> https://people.freebsd.org/~royger/xenstore_fix/ >> >> > I have tested this on 10.0 and it does fix the issue. After 36000 > allocations there are just 6 active at 13K > > xenstore 6 13K - 36699 16,32,64,128,256,512 > > > I looked in to why this only affected one of my many VMs as they run > xe-update-guest-attrs and nova-agent which should have triggered the leak. > They are all stuck on xsdread when reading from the xenstore so the update > loop has stopped. > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME > COMMAND > 0 13250 13249 0 20 0 16552 1968 xsdread S - 5:57.60 > /usr/local/bin/xenstore-read domid (xenstore) Is this with my patch applied? AFAICT xsdread means it's waiting on the address at dev->si_drv1, which is completely wrong because every time the device was opened this address changed. With my patch applied it should no longer be an issue. Roger.