From: Linus Torvalds <torvalds@linux-foundation.org>
To: Dave Chinner <dchinner@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>,
Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
"dm-devel@redhat.com" <dm-devel@redhat.com>,
Alasdair G Kergon <agk@redhat.com>, Joe Thornber <ejt@redhat.com>,
Mikulas Patocka <mpatocka@redhat.com>,
Vivek Goyal <vgoyal@redhat.com>,
Sami Tolvanen <samitolvanen@google.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Heinz Mauelshagen <heinzm@redhat.com>,
linux-mm <linux-mm@kvack.org>
Subject: Re: slab-nomerge (was Re: [git pull] device mapper changes for 4.3)
Date: Thu, 3 Sep 2015 08:02:40 -0700 [thread overview]
Message-ID: <CA+55aFxftNVWVD7ujseqUDNgbVamrFWf0PVM+hPnrfmmACgE0Q@mail.gmail.com> (raw)
In-Reply-To: <20150903060247.GV1933@devil.localdomain>
On Wed, Sep 2, 2015 at 11:02 PM, Dave Chinner <dchinner@redhat.com> wrote:
> On Wed, Sep 02, 2015 at 06:21:02PM -0700, Linus Torvalds wrote:
>> On Wed, Sep 2, 2015 at 5:51 PM, Mike Snitzer <snitzer@redhat.com> wrote:
>> >
>> > What I made possible with SLAB_NO_MERGE is for each subsystem to decide
>> > if they would prefer to not allow slab merging.
>>
>> .. and why is that a choice that even makes sense at that level?
>>
>> Seriously.
>>
>> THAT is the fundamental issue here.
>
> It makes a lot more sense than you think, Linus.
Not really. Even your argument isn't at all arguing for doing things
at a per-subsystem level - it's an argument about the potential sanity
of marking _individual_ slab caches non-mergable, not an argument for
something clearly insane like "mark all slabs for subsystem X
unmergable".
Can you just admit that that was insane? There is *no* sense in that
kind of behavior.
> Right, it's not xyzzy-specific where 'xyzzy' is a subsystem. The
> flag application is actually *object specific*. That is, the use of
> the individual objects that determines whether it should be merged
> or not.
Yes.
I do agree that something like SLAB_NO_MERGE can make sense on an
actual object-specific level, if you have very specific allocation
pattern knowledge and can show that the merging actually hurts.
But making the subsystem decide that all its slab caches should be
"no-merge" is just BS. You know that. It makes no sense, just admit
it.
> e.g. Slab fragmentation levels are affected more than anything by
> mixing objects with different life times in the same slab. i.e. if
> we free all the short lived objects from a page but there is one
> long lived object on the page then that page is pinned and we free
> no memory. Do that to enough pages in the slab, and we end up with a
> badly fragmented slab.
The thing is, *if* you can show that kind of behavior for a particular
slab, and have numbers for it, then mark that slab as no-merge, and
document why you did it.
Even then, I'd personally probably prefer to name the bit differently:
rather than talk about an internal implementation detail within slab
("don't merge") it would probably be better to try to frame it in the
semantic different you are looking for (ie in "I want a slab with
private allocation patterns").
But aside from that kind of naming issue, that's very obviously not
what the patch series discussed was doing.
And quite frankly, I don't actually think you have the numbers to show
that theoretical bad behavior. In contrast, there really *are*
numbers to show the advantages of merging.
So the fragmentation argument has been shown to generally be in favor
of merging, _not_ in favor of that "no-merge" behavior. If you have an
actual real load where that isn't the case, and can show it, then that
would be interesting, but at no point is that "the subsystem just
decided to mark all its slabs no-merge".
Linus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-03 15:02 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 23:13 slab-nomerge (was Re: [git pull] device mapper changes for 4.3) Linus Torvalds
2015-09-03 0:48 ` Andrew Morton
2015-09-03 0:53 ` Mike Snitzer
2015-09-03 0:51 ` Mike Snitzer
2015-09-03 1:21 ` Linus Torvalds
2015-09-03 2:31 ` Mike Snitzer
2015-09-03 3:10 ` Christoph Lameter
2015-09-03 4:55 ` Andrew Morton
2015-09-03 6:09 ` Pekka Enberg
2015-09-03 8:53 ` Dave Chinner
2015-09-03 3:11 ` Linus Torvalds
2015-09-03 6:02 ` Dave Chinner
2015-09-03 6:13 ` Pekka Enberg
2015-09-03 10:29 ` Jesper Dangaard Brouer
2015-09-03 16:19 ` Christoph Lameter
2015-09-04 9:10 ` Jesper Dangaard Brouer
2015-09-04 14:13 ` Christoph Lameter
2015-09-04 6:35 ` Sergey Senozhatsky
2015-09-04 7:01 ` Linus Torvalds
2015-09-04 7:59 ` Sergey Senozhatsky
2015-09-04 9:56 ` Sergey Senozhatsky
2015-09-04 14:05 ` Christoph Lameter
2015-09-04 14:11 ` Linus Torvalds
2015-09-05 2:09 ` Sergey Senozhatsky
2015-09-05 20:33 ` Linus Torvalds
2015-09-07 8:44 ` Sergey Senozhatsky
2015-09-08 0:22 ` Sergey Senozhatsky
2015-09-03 15:02 ` Linus Torvalds [this message]
2015-09-04 3:26 ` Dave Chinner
2015-09-04 3:51 ` Linus Torvalds
2015-09-05 0:36 ` Dave Chinner
2015-09-07 9:30 ` Jesper Dangaard Brouer
2015-09-07 20:22 ` Linus Torvalds
2015-09-07 21:17 ` Jesper Dangaard Brouer
2015-09-04 13:55 ` Christoph Lameter
2015-09-04 22:46 ` Dave Chinner
2015-09-05 0:25 ` Christoph Lameter
2015-09-05 1:16 ` Dave Chinner
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=CA+55aFxftNVWVD7ujseqUDNgbVamrFWf0PVM+hPnrfmmACgE0Q@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=agk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=dchinner@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ejt@redhat.com \
--cc=heinzm@redhat.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=mpatocka@redhat.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=samitolvanen@google.com \
--cc=snitzer@redhat.com \
--cc=vgoyal@redhat.com \
--cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).