linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Mikulas Patocka <mpatocka@redhat.com>,
	"xinhui.pan" <xinhuix.pan@intel.com>,
	linux-kernel@vger.kernel.org, agk@redhat.com, snitzer@redhat.com,
	dm-devel@redhat.com, "Liu, ShuoX" <shuox.liu@intel.com>
Subject: Re: [dm-devel] [PATCH] md/dm-ioctl.c: optimize memory allocation in copy_params
Date: Wed, 23 Jul 2014 11:15:09 +0800	[thread overview]
Message-ID: <53CF28BD.6050603@linux.intel.com> (raw)
In-Reply-To: <20140722020458.GE6822@agk-dp.fab.redhat.com>

On 2014/7/22 10:04, Alasdair G Kergon wrote:
> On Tue, Jul 22, 2014 at 02:23:52AM +0100, Alasdair G Kergon wrote:
>> Unanswered.  Let's ask the same question in a different way:
>   
> A quick search for 'vold' returns:
>    https://android.googlesource.com/platform/system/vold/
> and the code there requests a fixed 64K allocation to hold the names of
> active volumes.
>
> So unlike libdevmapper-based applications where a smaller allocation is
> used at first and only extended if needed, Android just assumes that
> 64KB is enough for everyone.
>
> So is your claim that:
>
> 1. This 64KB allocation for the brief duration of the ioctl to store the
> names of active device-mapper volumes leads to memory problems?
> [Mustn't the system *already* be in a bad state if this pushes it over
> the limit?]

It's a good question.
1) Usually, Android mobile runs for a long time. It's very command that
users don't turn off the phones for months. Users might start lots of
applications. memory is used up in the end. Kernel might recollect memory
over and over again.
2) We never blames this Out of memory issue fully to DM.
3) We want to improve the OOM issue.

>
> and
>
> 2. The systems on which this memory shortage occurs have so many volumes
> (with long names?) that a smaller allocation would not suffice?

64K is small, comparing with 2GB, even 4GB total memory. However, this 64K
by kmalloc has a strict criteria. It might be continuous physical memory
and align with 64K. If memory is used up, freed memory is very fragmented.
Such 64K criteria is a hard request.
Usually, driver can allocate such memory at booting initialization. After
that, it should allocate many sparse pages instead of continuous memory.
Here 64K allocation is after booting.

Thanks for the kind comments.

Yanmin


  reply	other threads:[~2014-07-23  3:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 10:22 [PATCH] md/dm-ioctl.c: optimize memory allocation in copy_params xinhui.pan
2014-07-08 22:39 ` [dm-devel] " Mikulas Patocka
2014-07-09  2:01   ` Zhang, Yanmin
2014-07-09  3:37     ` xinhui.pan
2014-07-09 14:53     ` Mikulas Patocka
2014-07-22  1:02       ` Zhang, Yanmin
2014-07-22  1:23         ` Alasdair G Kergon
2014-07-22  2:04           ` Alasdair G Kergon
2014-07-23  3:15             ` Zhang, Yanmin [this message]
2014-07-23  3:06           ` Zhang, Yanmin
2014-07-23 12:16             ` Mikulas Patocka
2014-07-23 12:54               ` Alasdair G Kergon
2014-07-23 17:14                 ` Mikulas Patocka
2014-07-24  5:53                   ` Zhang, Yanmin
2014-07-23 12:39         ` Mikulas Patocka

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=53CF28BD.6050603@linux.intel.com \
    --to=yanmin_zhang@linux.intel.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=shuox.liu@intel.com \
    --cc=snitzer@redhat.com \
    --cc=xinhuix.pan@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).