From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SOuL8-0008Mk-VN for mharc-grub-devel@gnu.org; Mon, 30 Apr 2012 13:24:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOuL4-0008IS-DH for grub-devel@gnu.org; Mon, 30 Apr 2012 13:24:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOuL2-0007hl-G1 for grub-devel@gnu.org; Mon, 30 Apr 2012 13:24:41 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:38877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOuL2-0007gb-7d for grub-devel@gnu.org; Mon, 30 Apr 2012 13:24:40 -0400 Received: by werj55 with SMTP id j55so2587660wer.0 for ; Mon, 30 Apr 2012 10:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=uCPRmIiYX5Y+q7q0PUfP5/ZbD5ZDaUCBLEJyB7onwcQ=; b=cm1oMM2EJ9glAYrik1xfsiIN19EYW7U2Fb/ez0c2R2xMwVwNfi8pVYvNnRrmmzFngH MmL/IOL+7OdKfi8/Tw/EomcIdIAIoJh8jcyhRKog0NK/Bp7Cdz7G8f2Ih5mhaS2XroUd z3PA3+fLVe4+7mB9j5dn0CyYxDiQ7XgBkK526RuDl8OPiqYg0OTlCMD3YDLhBTDFroKH GJn5Z90dJsBuOurLYuhPmK94q8BpnAPN/QJHWSo3qhjDAQe7oZ3gS57R6TIDbsDORg9Z 1iIkK08F5p9YGAa28JM5LUy5+b4uEw2Qo+5fHuFnVz1iCr2Gkf68aHQaiWlZc6wJnfYM cGIg== Received: by 10.180.86.132 with SMTP id p4mr30791089wiz.15.1335806677211; Mon, 30 Apr 2012 10:24:37 -0700 (PDT) Received: from debian.x201.phnet (29-234.197-178.cust.bluewin.ch. [178.197.234.29]) by mx.google.com with ESMTPS id fn2sm47111232wib.0.2012.04.30.10.24.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Apr 2012 10:24:36 -0700 (PDT) Message-ID: <4F9ECACF.6050803@gmail.com> Date: Mon, 30 Apr 2012 19:24:31 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120329 Icedove/10.0.3 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: RFC: enhanced memory protection support References: In-Reply-To: X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigB0C264258A6723408F1CB8B1" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2012 17:24:43 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB0C264258A6723408F1CB8B1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 30.04.2012 17:26, Bean wrote: > Hi, > > While testing network function in efi mode, I've found several memory > leak related to fragmentation, but there is still some memory problem > that's very tricky to locate. For example, you can run testspeed on a > large file several times in a row and it could show the memory error. > Since network condition are very difficult to reproduce, I have to > look at the source of this issue, memory allocation. Currently it has > mm_debug option that could print out file and line number of each > memory call, but it's quite useless since we can't find the relevant > informaton with full screen of prints. > Here are some of my ideas for enhanced memory protection support: > > 1, when we allocate memory, we append some information at the end of > the buffer, which include filename, lineno of caller, and tag to > indicate what is used for and some padding to detect memory overwrite > problem. > > 2. add a command to print the current memory list with extended > information, this can be used to find memory leaks. > > 3. it's also a good idea to run the memory check in automated test to > locate potential issue. This is pretty easy to do leveraging some of the code I did for POSIX support. But: - Due to additional time and space required it should be done only when mm-debug is enabled. - The additional data has to be stored before rather than after the range since we store all the info before. - Integrating with automated tests isn't that easy since some memory is intentionally never freed i.a. disk cache or otherwise in use (i.a. terminal). We need exceptions for those. I have half-working patch, just needs few fixes. --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigB0C264258A6723408F1CB8B1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk+eys8ACgkQNak7dOguQgkGxQD7BTzJLHjr0BPEm+2lF/JmPlOW xUnqrHbTBnX5cm14hf4A/ju0PNQlaQMXjAeI5Qe9vS5uO7+Z2YoEj24wsb958brg =gin+ -----END PGP SIGNATURE----- --------------enigB0C264258A6723408F1CB8B1--