From patchwork Tue Oct 9 19:36:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10633215 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5A9114DB for ; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1DAD29522 for ; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9470529715; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 41EFB29522 for ; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5F963082B60; Tue, 9 Oct 2018 19:36:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54FB27856B; Tue, 9 Oct 2018 19:36:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6D9834BB79; Tue, 9 Oct 2018 19:36:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w99JaOss027206 for ; Tue, 9 Oct 2018 15:36:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id C733B77BEB; Tue, 9 Oct 2018 19:36:24 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE78A6A94B; Tue, 9 Oct 2018 19:36:18 +0000 (UTC) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AB268764F; Tue, 9 Oct 2018 19:36:17 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42V6rz20zwz1D; Tue, 9 Oct 2018 21:35:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1539113731; bh=J9e+DfrSZShTR7juCkiHqgE9m6M0E+Yjfwdo0B0KlMM=; h=Date:References:From:Subject:To:Cc:From; b=ezS44rbzUkssfiE6Mpw7ftu5Z9SlLS2D7pN47ZHdKbTqRv3i99a4/iW0dTvnUNEcK TIkWRhGRR7q1TaHeiSPvzDTHIvsRJaI214hDQ5zAAa36Ym4jh2K27M1/mL+9/t+kVW /LZovs8nrcc7A/LBR/sk5Y3JOzFwThZBMwTIq5d+fsdNESAd34c6y2i95VhSHRe4/n RHx0OPP5Y6PaiaX4u4lu38XW0Lago+jQqVxLNQ9/A9iOoriDKH3HpNlxYeLCfhYd8Q j6DWff2khWGwXzw7+QGHpVgQMuAy/tlP2AxqqDP2amyPFkmomE17kdLuWWi2ohTyv6 uJ2jHVFFPN5pQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.1 at mail Date: Tue, 09 Oct 2018 21:36:15 +0200 Message-Id: References: <614cd7a2d51cf5db0583e4b9a2e2d59c8a4da7a9.1539113066.git.mirq-linux@rere.qmqm.pl> From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: Alasdair Kergon , Mike Snitzer X-Greylist: Sender passed SPF test, ACL 236 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 09 Oct 2018 19:36:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 09 Oct 2018 19:36:17 +0000 (UTC) for IP:'91.227.64.183' DOMAIN:'rere.qmqm.pl' HELO:'rere.qmqm.pl' FROM:'mirq-linux@rere.qmqm.pl' RCPT:'' X-RedHat-Spam-Score: -0.102 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS) 91.227.64.183 rere.qmqm.pl 91.227.64.183 rere.qmqm.pl X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 1/2] dm: add dm_table_device_name() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 09 Oct 2018 19:36:28 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Add a shortcut for dm_device_name(dm_table_get_md(t)). Signed-off-by: Michał Mirosław --- drivers/md/dm-table.c | 6 ++++++ include/linux/device-mapper.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 3d0e2c198f06..1f4ab9c8b9a8 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -2079,6 +2079,12 @@ struct mapped_device *dm_table_get_md(struct dm_table *t) } EXPORT_SYMBOL(dm_table_get_md); +const char *dm_table_device_name(struct dm_table *t) +{ + return dm_device_name(t->md); +} +EXPORT_SYMBOL(dm_table_device_name); + void dm_table_run_md_queue_async(struct dm_table *t) { struct mapped_device *md; diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 6fb0808e87c8..0d63f7e5261c 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -490,6 +490,7 @@ sector_t dm_table_get_size(struct dm_table *t); unsigned int dm_table_get_num_targets(struct dm_table *t); fmode_t dm_table_get_mode(struct dm_table *t); struct mapped_device *dm_table_get_md(struct dm_table *t); +const char *dm_table_device_name(struct dm_table *t); /* * Trigger an event. From patchwork Tue Oct 9 19:36:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10633217 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E697213BB for ; Tue, 9 Oct 2018 19:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3EFE29522 for ; Tue, 9 Oct 2018 19:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C543029715; Tue, 9 Oct 2018 19:36:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6607029522 for ; Tue, 9 Oct 2018 19:36:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5AE4CF3C; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E1937E389; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 31D024CA94; Tue, 9 Oct 2018 19:36:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w99JaPOE027220 for ; Tue, 9 Oct 2018 15:36:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7EB24111F3DD; Tue, 9 Oct 2018 19:36:25 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.rdu2.redhat.com [10.11.55.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ADD52111F3DA; Tue, 9 Oct 2018 19:36:21 +0000 (UTC) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 69705401CC41; Tue, 9 Oct 2018 19:36:19 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42V6rz4MXxz1V; Tue, 9 Oct 2018 21:35:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1539113731; bh=H91W5oV1ljvLM5ZPjdj+J+MuANb2WdxQ6a3U27ZFxHM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=ITS8Eckk/X2jqKOskBwlK4/cVoWcPJI+EH4PeJuNeZJKUbx09jgDoYt1vS3G7GG0q JWBmBekOmBs702UkMOXzPrvNNO8qzHjOOVeQjTPVuyxLRb8cJlW6j7pMyGnIu095cG Vbs0/zkD17olPf1iYDbBzvaEXk0M//GNJwkuH4MoFhyaEXOIrlMyqp7vdrlBxK+gr6 qwOIdsX+b/h9ny/AkQ66iuar933reMqIAaXdfFWN3PlsAwOVq0kzva/Q7lqIRbxvur gEcpU0q29TMWH0ZmhIuGZzMmnhBy32tNEOkSXvCot4/DDeWQWscvayiTefsBMX/jqK zOz+ESXKnIqEQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.1 at mail Date: Tue, 09 Oct 2018 21:36:16 +0200 Message-Id: <0b175c0ba59c61c1f0363ed033a4012e0f78d701.1539113382.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: <614cd7a2d51cf5db0583e4b9a2e2d59c8a4da7a9.1539113066.git.mirq-linux@rere.qmqm.pl> From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: Alasdair Kergon , Mike Snitzer X-Greylist: Sender passed SPF test, ACL 236 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 09 Oct 2018 19:36:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 09 Oct 2018 19:36:19 +0000 (UTC) for IP:'91.227.64.183' DOMAIN:'rere.qmqm.pl' HELO:'rere.qmqm.pl' FROM:'mirq-linux@rere.qmqm.pl' RCPT:'' X-RedHat-Spam-Score: -0.102 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS) 91.227.64.183 rere.qmqm.pl 91.227.64.183 rere.qmqm.pl X-Scanned-By: MIMEDefang 2.78 on 10.11.55.5 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 2/2 v2] dm-crypt: make workqueue names device-specific X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 09 Oct 2018 19:36:30 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Michał Mirosław --- v2: - include dependency: dm_table_device_name() patch --- drivers/md/dm-crypt.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 0481223b1deb..b5eda64d3840 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2661,6 +2661,7 @@ static int crypt_ctr_optional(struct dm_target *ti, unsigned int argc, char **ar static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) { struct crypt_config *cc; + const char *devname = dm_table_device_name(ti->table); int key_size; unsigned int align_mask; unsigned long long tmpll; @@ -2806,18 +2807,22 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) } ret = -ENOMEM; - cc->io_queue = alloc_workqueue("kcryptd_io", WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1); + cc->io_queue = alloc_workqueue("kcryptd_io/%s", + WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, + 1, devname); if (!cc->io_queue) { ti->error = "Couldn't create kcryptd io queue"; goto bad; } if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags)) - cc->crypt_queue = alloc_workqueue("kcryptd", WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1); + cc->crypt_queue = alloc_workqueue("kcryptd/%s", + WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, + 1, devname); else - cc->crypt_queue = alloc_workqueue("kcryptd", + cc->crypt_queue = alloc_workqueue("kcryptd/%s", WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND, - num_online_cpus()); + num_online_cpus(), devname); if (!cc->crypt_queue) { ti->error = "Couldn't create kcryptd queue"; goto bad; @@ -2826,7 +2831,8 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) spin_lock_init(&cc->write_thread_lock); cc->write_tree = RB_ROOT; - cc->write_thread = kthread_create(dmcrypt_write, cc, "dmcrypt_write"); + cc->write_thread = kthread_create(dmcrypt_write, cc, + "dmcrypt_write/%s", devname); if (IS_ERR(cc->write_thread)) { ret = PTR_ERR(cc->write_thread); cc->write_thread = NULL;