From: Christoph Hellwig <hch@infradead.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Mike Snitzer <msnitzer@redhat.com>,
Daniel Wagner <daniel.wagner@bmw-carit.de>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [dm-devel] [PATCH 1/2] swait: export the symbols __prepare_to_swait and __finish_swait
Date: Thu, 23 Nov 2017 00:28:57 -0800 [thread overview]
Message-ID: <20171123082857.GA17859@infradead.org> (raw)
In-Reply-To: <alpine.LRH.2.02.1711222134370.2330@file01.intranet.prod.int.rdu2.redhat.com>
Please run this past the swait authors. It is supposed to be a simple
and self-contained API so I'd expect this patch to be seen critical.
You might be better off to just use the normal complex waitqueues if
you want to micro-optimize like this.
On Wed, Nov 22, 2017 at 09:35:36PM -0500, Mikulas Patocka wrote:
> In order to reduce locking overhead, I use the spinlock in
> swait_queue_head to protect not only the wait queue, but also the list of
> events. Consequently, I need to use unlocked functions __prepare_to_swait
> and __finish_swait. These functions are declared in the file
> include/linux/swait.h, but they are not exported, and so they are not
> useable from kernel modules.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>
> ---
> kernel/sched/swait.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> Index: linux-2.6/kernel/sched/swait.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched/swait.c
> +++ linux-2.6/kernel/sched/swait.c
> @@ -73,6 +73,7 @@ void __prepare_to_swait(struct swait_que
> if (list_empty(&wait->task_list))
> list_add(&wait->task_list, &q->task_list);
> }
> +EXPORT_SYMBOL(__prepare_to_swait);
>
> void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state)
> {
> @@ -102,6 +103,7 @@ void __finish_swait(struct swait_queue_h
> if (!list_empty(&wait->task_list))
> list_del_init(&wait->task_list);
> }
> +EXPORT_SYMBOL(__finish_swait);
>
> void finish_swait(struct swait_queue_head *q, struct swait_queue *wait)
> {
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
---end quoted text---
next parent reply other threads:[~2017-11-23 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.LRH.2.02.1711222134370.2330@file01.intranet.prod.int.rdu2.redhat.com>
2017-11-23 8:28 ` Christoph Hellwig [this message]
2017-11-23 22:27 ` [dm-devel] [PATCH 1/2] swait: export the symbols __prepare_to_swait and __finish_swait Mikulas Patocka
2018-05-18 21:03 ` Mike Snitzer
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=20171123082857.GA17859@infradead.org \
--to=hch@infradead.org \
--cc=daniel.wagner@bmw-carit.de \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=msnitzer@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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