From: Giuseppe Scrivano <gscrivan@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
mingo@kernel.org, dave@stgolabs.net
Subject: Re: [RFC PATCH] ipc, mqueue: lazy call kern_mount_data in new namespaces
Date: Thu, 30 Nov 2017 13:20:11 +0100 [thread overview]
Message-ID: <87o9nkj6v8.fsf@redhat.com> (raw)
In-Reply-To: <20171129141744.5d401ff613116b0bde02cff3@linux-foundation.org> (Andrew Morton's message of "Wed, 29 Nov 2017 14:17:44 -0800")
Andrew Morton <akpm@linux-foundation.org> writes:
> On Wed, 29 Nov 2017 11:33:28 +0100 Giuseppe Scrivano <gscrivan@redhat.com> wrote:
>
>> Andrew Morton <akpm@linux-foundation.org> writes:
>>
>> > OK, but this simply moves the expense so it happens later on. Why is
>> > that better?
>>
>> the optimization is for new IPC namespaces that don't use mq_open. In
>> this case there won't be any kern_mount_data cost at all.
>>
>
> Fair enough. Please add this paragraph (or similar) to the changelog:
>
> : This is a net saving for new IPC namespaces that don't use mq_open(). In
> : this case there won't be any kern_mount_data() cost at all
>
> And.. the patch calls
> kern_mount_data()->vfs_kern_mount()->...->kmem_cache_zalloc(GFP_KERNEL)
> under spin_lock(). This should have created a might_sleep() warning in
> your testing, but obviously did not.
>
> Could you please find out why? Do you have
> CONFIG_DEBUG_ATOMIC_SLEEP=n, I hope? Please peruse
> Documentation/process/submit-checklist.rst, section 12...
>
> I assume a suitable fix would be to create a new mutex (static to
> do_mq_open()) to prevent concurrent mounting.
thanks for the hints.
Indeed, that was a mistake on my side as I didn't use
CONFIG_DEBUG_ATOMIC_SLEEP=y. The might_sleep() warning is correctly
raised once I enable CONFIG_DEBUG_ATOMIC_SLEEP (and the other options
suggested in submit-checklist.rst).
Giuseppe
prev parent reply other threads:[~2017-11-30 12:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 12:55 [RFC PATCH] ipc, mqueue: lazy call kern_mount_data in new namespaces Giuseppe Scrivano
2017-11-28 7:09 ` Davidlohr Bueso
2017-11-28 21:53 ` Andrew Morton
2017-11-29 10:33 ` Giuseppe Scrivano
2017-11-29 22:17 ` Andrew Morton
2017-11-30 12:20 ` Giuseppe Scrivano [this message]
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=87o9nkj6v8.fsf@redhat.com \
--to=gscrivan@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.