From: "John Smith" <john.smith@pace.com>
To: <dedekind@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBI memory leak after creating and removing volumes
Date: Sat, 21 Feb 2009 21:30:44 +0000 [thread overview]
Message-ID: <49A07284.3070201@pace.com> (raw)
In-Reply-To: <1234885159.17790.280.camel@localhost.localdomain>
Previously I said:
> On Tue, 2009-02-17 at 12:01 +0000, John.Smith@pace.com wrote:
> > I am using a 2.6.18 Kernel, patched with MTD from Kernel 2.6.21, and
> > UBI from the mainline kernel a few days later on 1 May 2007. The
> > whole is running on an embedded MIPS device.
> >
The problem is still present on current versions of Linux. I have
tested on 2.6.28.6 using QEMU to make a virtual x86.
With these settings in the kernel .config file:
CONFIG_MTD=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTD_UBI=y
then a sequence of calls of the form
for ((i=0; i<100; i++)) ; do
ubimkvol -d 0 -n 2 -N vol2 -s 1000
ubimkvol -d 0 -n 3 -N vol3 -s 1000
ubirmvol -d 0 -n 3
ubirmvol -d 0 -n 2
done
cat /proc/meminfo | grep Slab
shows Slab increasing by about 1.6kB per iteration
The problem can also be demonstrated using MTD modules,
without using UBI. If I build two MTD simulated devices
as kernel modules using these settings in .config:
CONFIG_MTD_MTDRAM=m
CONFIG_MTD_NAND_NANDSIM=m
then
insmod mtdram.ko
insmod nandsim.ko
rmmod nandsim.ko
rmmod mtdram.ko
shows a similar leak of about 1.6kB.
The leak does not happen if the calls are not nested. So
insmod mtdram.ko
rmmod mtdram.ko
insmod nandsim.ko
rmmod nandsim.ko
and
ubimkvol -d 0 -n 2 -N vol2 -s 1000
ubirmvol -d 0 -n 2
ubimkvol -d 0 -n 3 -N vol3 -s 1000
ubirmvol -d 0 -n 3
do not leak.
The leak does not happen if
# CONFIG_MTD_BLKDEVS is not set.
From /proc/slabinfo it seems that we are leaking sysfs_dir_cache
objects.
John
John Smith
p.s. some automatic system is about to add a silly disclaimer. Ingore it...
This E-mail and any attachments hereto are strictly confidential and intended solely for the addressee. If you are not the intended addressee please notify the sender by return and delete the message. You must not disclose, forward or copy this E-mail or attachments to any third party without the prior consent of the sender. Pace plc is registered in England and Wales (Company no. 1672847) and our Registered Office is at Victoria Road, Saltaire, West Yorkshire, BD18 3LF, UK. Tel +44 (0) 1274 532000 Fax +44 (0) 1274 532010. <http://www.pace.com>
Save where otherwise agreed in writing between you and Pace (i) all orders for goods and/or services placed by you are made pursuant to Pace's standard terms and conditions of sale which may have been provided to you, or in any event are available at http://www.pace.com/uktcsale.pdf (ii) all orders for goods and/or services placed by Pace are subject to Pace's standard terms and conditions of purchase which may have been provided to you, or in any event are available at http://www.pace.com/uktcpurch.pdf. All other inconsistent terms in any other documentation including without limitation any purchase order, reschedule instruction, order acknowledgement, delivery note or invoice are hereby excluded.
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
next prev parent reply other threads:[~2009-02-21 22:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 14:33 UBI memory leak after creating and removing volumes John.Smith
2009-02-17 15:24 ` Artem Bityutskiy
2009-02-17 15:24 ` Artem Bityutskiy
2009-02-17 22:02 ` John Smith
2009-02-17 15:39 ` Artem Bityutskiy
2009-02-21 21:30 ` John Smith [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-02-17 12:01 John.Smith
2009-02-17 12:23 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49A07284.3070201@pace.com \
--to=john.smith@pace.com \
--cc=dedekind@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox