From: Arnd Bergmann <arnd@arndb.de>
To: Vitaly Wool <vitalywool@gmail.com>
Cc: Joe Perches <joe@perches.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dan Streetman <ddstreet@ieee.org>,
zhong jiang <zhongjiang@huawei.com>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] z3fold: use %z modifier for format string
Date: Fri, 25 Nov 2016 09:41:53 +0100 [thread overview]
Message-ID: <3177176.drX8hSSUx4@wuerfel> (raw)
In-Reply-To: <CAMJBoFN=32B3aaU2XyJO7dNmZ3gMxmOYboVoWH3z7ALosSdmUQ@mail.gmail.com>
On Friday, November 25, 2016 8:38:25 AM CET Vitaly Wool wrote:
> >> diff --git a/mm/z3fold.c b/mm/z3fold.c
> >> index e282ba073e77..66ac7a7dc934 100644
> >> --- a/mm/z3fold.c
> >> +++ b/mm/z3fold.c
> >> @@ -884,7 +884,7 @@ static int __init init_z3fold(void)
> >> {
> >> /* Fail the initialization if z3fold header won't fit in one chunk */
> >> if (sizeof(struct z3fold_header) > ZHDR_SIZE_ALIGNED) {
> >> - pr_err("z3fold: z3fold_header size (%d) is bigger than "
> >> + pr_err("z3fold: z3fold_header size (%zd) is bigger than "
> >> "the chunk size (%d), can't proceed\n",
> >> sizeof(struct z3fold_header) , ZHDR_SIZE_ALIGNED);
> >> return -E2BIG;
> >
> > The embedded "z3fold: " prefix here should be removed
> > as there's a pr_fmt that also adds it.
> >
> > The test looks like it should be a BUILD_BUG_ON rather
> > than any runtime test too.
>
> It used to be BUILD_BUG_ON but we deliberately changed that because
> sizeof(spinlock_t) gets bloated in debug builds, so it just won't
> build with default CHUNK_SIZE.
Could this be improved by making the CHUNK_SIZE bigger depending on
the debug options?
Alternatively, how about using a bit_spin_lock instead of raw_spin_lock?
That would guarantee a fixed size for the lock and make z3fold_header
always 24 bytes (on 32-bit architectures) or 40 bytes
(on 64-bit architectures). You could even play some tricks with the
first_num field to make it fit in the same word as the lock and make the
structure fit into 32 bytes if you care about that.
Arnd
--
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:[~2016-11-25 8:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-24 16:31 Arnd Bergmann
2016-11-24 17:08 ` Joe Perches
2016-11-25 7:38 ` Vitaly Wool
2016-11-25 8:41 ` Arnd Bergmann [this message]
2016-11-25 15:51 ` Vitaly Wool
2016-11-25 16:11 ` Arnd Bergmann
2016-11-25 18:36 ` Dan Streetman
2016-11-25 7:35 ` Vitaly Wool
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=3177176.drX8hSSUx4@wuerfel \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=ddstreet@ieee.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=vitalywool@gmail.com \
--cc=zhongjiang@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