linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: yangerkun <yangerkun@huawei.com>
To: Matthew Wilcox <willy@infradead.org>,
	Greg KH <gregkh@linuxfoundation.org>, <joe@perches.com>
Cc: <stable@vger.kernel.org>, <vbabka@suse.cz>, <linux-mm@kvack.org>,
	<open-iscsi@googlegroups.com>, <cleech@redhat.com>,
	"zhangyi (F)" <yi.zhang@huawei.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	<liuyongqiang13@huawei.com>,
	"Zhengyejian (Zetta)" <zhengyejian1@huawei.com>,
	Yang Yingliang <yangyingliang@huawei.com>,
	<chenzhou10@huawei.com>
Subject: Re: [QUESTION] WARNNING after 3d8e2128f26a ("sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output")
Date: Wed, 7 Apr 2021 20:14:52 +0800	[thread overview]
Message-ID: <08b739b5-4401-e550-2028-1ce43db38141@huawei.com> (raw)
In-Reply-To: <20210402144120.GO351017@casper.infradead.org>



在 2021/4/2 22:41, Matthew Wilcox 写道:
> On Fri, Apr 02, 2021 at 09:45:12AM +0200, Greg KH wrote:
>> Why is the buffer alignment considered a "waste" here?  If that change
>> is in Linus's tree and newer kernels (it showed up in 5.4 which was
>> released quite a while ago), where are the people complaining about it
>> there?
>>
>> I think backporting 59bb47985c1d ("mm, sl[aou]b: guarantee natural
>> alignment for kmalloc(power-of-two)") seems like the correct thing to do
>> here to bring things into alignment (pun intended) with newer kernels.
> 
> It's only a waste for slabs which need things like redzones (eg we could
> get 7 512-byte allocations out of a 4kB page with a 64 byte redzone
> and no alignment ; with alignment we can only get four).  Since slub
> can enable/disable redzones on a per-slab basis, and redzones aren't
> terribly interesting now that we have kasan/kfence, nobody really cares.
> 
> .
> 

Thanks for your explain! The imfluence seems minimal since the "waste" 
will happen only when we enable slub_debug.

One more question for Joe Perches. Patch v2[1] does not add the
alignment check for buf and we add it in v3[2]. I don't see the
necessity for this check... Can you help to explain that why we need this?

Thanks,
Kun.


[1]. 
https://lore.kernel.org/lkml/a9054fb521e65f2809671fa9c18e2453061e9d91.1598744610.git.joe@perches.com/
[2]. 
https://lore.kernel.org/lkml/743a648dc817cddd2e7046283c868f1c08742f29.camel@perches.com/


  reply	other threads:[~2021-04-07 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  7:16 yangerkun
2021-04-02  7:24 ` yangerkun
2021-04-02  7:45 ` Greg KH
2021-04-02 14:41   ` Matthew Wilcox
2021-04-07 12:14     ` yangerkun [this message]
2021-04-07 13:21       ` Joe Perches
2021-04-07 13:49         ` yangerkun

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=08b739b5-4401-e550-2028-1ce43db38141@huawei.com \
    --to=yangerkun@huawei.com \
    --cc=chenzhou10@huawei.com \
    --cc=cleech@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-mm@kvack.org \
    --cc=liuyongqiang13@huawei.com \
    --cc=open-iscsi@googlegroups.com \
    --cc=stable@vger.kernel.org \
    --cc=vbabka@suse.cz \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=yangyingliang@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=zhengyejian1@huawei.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