From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Steven Walter <stevenrwalter@gmail.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/3] drivers/tty: refactor functions for flushing/queuing work
Date: Mon, 11 Mar 2019 09:16:59 +0100 [thread overview]
Message-ID: <20190311091659.c9acd07eab2f5d19c3e00369@gmail.com> (raw)
In-Reply-To: <20190110101232.9398-2-o.rempel@pengutronix.de>
Hello Oleksij,
On Thu, 10 Jan 2019 11:12:30 +0100
Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> From: Steven Walter <stevenrwalter@gmail.com>
>
> Preparation for converting to kthread_worker
>
> Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> ---
> drivers/tty/tty_buffer.c | 12 +++++++++---
> include/linux/tty.h | 1 +
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
> index 77070c2d1240..e0090e65d83a 100644
> --- a/drivers/tty/tty_buffer.c
> +++ b/drivers/tty/tty_buffer.c
> @@ -72,7 +72,7 @@ void tty_buffer_unlock_exclusive(struct tty_port *port)
> atomic_dec(&buf->priority);
> mutex_unlock(&buf->lock);
> if (restart)
> - queue_work(system_unbound_wq, &buf->work);
> + tty_buffer_queue_work(port);
> }
> EXPORT_SYMBOL_GPL(tty_buffer_unlock_exclusive);
>
> @@ -410,7 +410,7 @@ void tty_schedule_flip(struct tty_port *port)
> * flush_to_ldisc() sees buffer data.
> */
> smp_store_release(&buf->tail->commit, buf->tail->used);
> - queue_work(system_unbound_wq, &buf->work);
> + tty_buffer_queue_work(port);
> }
> EXPORT_SYMBOL(tty_schedule_flip);
>
> @@ -557,6 +557,12 @@ void tty_flip_buffer_push(struct tty_port *port)
> }
> EXPORT_SYMBOL(tty_flip_buffer_push);
>
> +bool tty_buffer_queue_work(struct tty_port *port)
> +{
> + struct tty_bufhead *buf = &port->buf;
> + return schedule_work(&buf->work);
> +}
> +
> /**
> * tty_buffer_init - prepare a tty buffer structure
> * @tty: tty to initialise
> @@ -605,7 +611,7 @@ void tty_buffer_set_lock_subclass(struct tty_port *port)
>
> bool tty_buffer_restart_work(struct tty_port *port)
> {
> - return queue_work(system_unbound_wq, &port->buf.work);
> + return tty_buffer_queue_work(port);
> }
>
> bool tty_buffer_cancel_work(struct tty_port *port)
> diff --git a/include/linux/tty.h b/include/linux/tty.h
> index bfa4e2ee94a9..226a9eff0766 100644
> --- a/include/linux/tty.h
> +++ b/include/linux/tty.h
> @@ -507,6 +507,7 @@ extern void session_clear_tty(struct pid *session);
> extern void no_tty(void);
> extern void tty_buffer_free_all(struct tty_port *port);
> extern void tty_buffer_flush(struct tty_struct *tty, struct tty_ldisc *ld);
> +extern bool tty_buffer_queue_work(struct tty_port *port);
> extern void tty_buffer_init(struct tty_port *port);
> extern void tty_buffer_set_lock_subclass(struct tty_port *port);
> extern bool tty_buffer_restart_work(struct tty_port *port);
--
Alexander Sverdlin.
next prev parent reply other threads:[~2019-03-11 8:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 10:12 [PATCH v1 0/3] reduce tty latency Oleksij Rempel
2019-01-10 10:12 ` [PATCH v1 1/3] drivers/tty: refactor functions for flushing/queuing work Oleksij Rempel
2019-03-11 8:16 ` Alexander Sverdlin [this message]
2019-01-10 10:12 ` [PATCH v1 2/3] drivers/tty: convert tty_port to use kthread_worker Oleksij Rempel
2019-03-11 8:23 ` Alexander Sverdlin
2019-01-10 10:12 ` [PATCH v1 3/3] drivers/tty: increase priority for tty_buffer_worker Oleksij Rempel
2019-01-10 12:54 ` Linus Torvalds
2019-01-10 15:19 ` Oleksij Rempel
2019-01-10 16:30 ` Greg Kroah-Hartman
2019-01-28 8:05 ` Oleksij Rempel
2019-01-28 8:23 ` Greg Kroah-Hartman
2019-01-28 9:22 ` Oleksij Rempel
2019-01-28 20:03 ` Linus Torvalds
2019-01-28 20:13 ` Linus Torvalds
2019-01-10 16:59 ` Linus Torvalds
2019-03-11 8:24 ` Alexander Sverdlin
2019-01-10 13:51 ` [PATCH v1 0/3] reduce tty latency Greg Kroah-Hartman
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=20190311091659.c9acd07eab2f5d19c3e00369@gmail.com \
--to=alexander.sverdlin@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=stevenrwalter@gmail.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
Powered by JetHome