From patchwork Tue Oct 9 20:13:42 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: 10633245 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 5748413BB for ; Tue, 9 Oct 2018 20:14:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D29E29486 for ; Tue, 9 Oct 2018 20:14:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4138B2948F; Tue, 9 Oct 2018 20:14:18 +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 E297929486 for ; Tue, 9 Oct 2018 20:14:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 983E0C0AF7B2; Tue, 9 Oct 2018 20:14:16 +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 4D988503E9; Tue, 9 Oct 2018 20:14:16 +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 09B464BB79; Tue, 9 Oct 2018 20:14:16 +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 w99KDqR5031551 for ; Tue, 9 Oct 2018 16:13:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D69F111F3DD; Tue, 9 Oct 2018 20:13:52 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.rdu2.redhat.com [10.11.55.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 727CF111F3DA; Tue, 9 Oct 2018 20:13:48 +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 6EBCC7D84D; Tue, 9 Oct 2018 20:13:46 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42V7hB2pH9z1D; Tue, 9 Oct 2018 22:12:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1539115978; bh=l8KqCYJnOFGh7i86DrCuDAq0W3q3tg8cfKPd422eSeE=; h=Date:From:Subject:In-Reply-To:References:To:Cc:From; b=FNFAPxCUGsICXjJkEhkDKVdlVQsKcqWVZ7HyYk1U0XWr8X4UX7cklGef+/kHpuomg xf3ZAc8QCFe2j5HZk9psQVzIxfmmvxc7KcswVnss+iF+S3uqUNNW45VEIaDjIFGJPi /Emu5r5gP4tLxtkLIRmQ3Ci+xq/DLOQObd4BxYVEENPWD8mktpIIl/cAe3gbUT42ci /Izy1HS4HhcSGSIHhxLcXqrEC+Xlue89yY2S6SxYuvhcoFqoo30jEzoU2Ke+fzGhbU hJRcksQqmKJtB33485rdnKsaJvx8bocXMY9VGhCa4vrgldSQUYwuaNMCVNnvM1MF/O txRk4AR+yBmDA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.1 at mail Date: Tue, 09 Oct 2018 22:13:42 +0200 Message-Id: <80a39e1a5beb7137b7112ae8b2302cb168bebdd3.1539115528.git.mirq-linux@rere.qmqm.pl> From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= In-Reply-To: <20181009194250.GB4974@redhat.com> References: <20181009194250.GB4974@redhat.com> 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.2]); Tue, 09 Oct 2018 20:13:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 09 Oct 2018 20:13:46 +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.2 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 v2 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 09 Oct 2018 20:14:17 +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 --- v2: use EXPORT_SYMBOL_GPL like dm_device_name() --- 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..792de0a44cd8 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_GPL(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 20:13:43 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: 10633243 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 4390313AD for ; Tue, 9 Oct 2018 20:13:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 373B629486 for ; Tue, 9 Oct 2018 20:13:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B801294AF; Tue, 9 Oct 2018 20:13:57 +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 B104629486 for ; Tue, 9 Oct 2018 20:13:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BC3F308213A; Tue, 9 Oct 2018 20:13:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 61B2C60C5C; Tue, 9 Oct 2018 20:13:54 +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 8A74C18005B0; Tue, 9 Oct 2018 20:13:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w99KDqwC031550 for ; Tue, 9 Oct 2018 16:13:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C5AE600C2; Tue, 9 Oct 2018 20:13:52 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71ADF600C1; Tue, 9 Oct 2018 20:13:46 +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 F11D0308FC51; Tue, 9 Oct 2018 20:13:44 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42V7hB54Q6z1V; Tue, 9 Oct 2018 22:12:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1539115978; bh=OkE0geuL20SFMPvzVI1jTvmxm8DlkL3ahQlmKsyKxkg=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=WQcmbW9hsDmvQoBeYhpJpONUxdCdLhf5vAFgupNVgNsLXDEdtmhguiTkiuCuxuA+1 7dJoIvfzuQua8+DBkOuUWLuz1lfieBZ+ZC3geobEoG804uTIrK+YwGeuS2b4TMQxhS iNqnDbuxpVB9PNFIMxpAyEnY1FGyr7qJC3iENedhhxFw2v6fCRA9/cGk3HvE2guz0h PjCiQnM/oqwAJkMY4tf/yKBDyLxMvTkT0sXBcWzxr4FNuaiqHcXqS3SI9GbgoDHOdh am3Qjzi+pK08i1HeE8v0JATImrxnJ9bHmJpMLGdTuavdXNG3RyjRVkkicF85SFJ4hu pY0iZ1fQI6Ehg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.1 at mail Date: Tue, 09 Oct 2018 22:13:43 +0200 Message-Id: <33b1c6a4ae776c7f772527efa677b7759acef837.1539115528.git.mirq-linux@rere.qmqm.pl> In-Reply-To: <80a39e1a5beb7137b7112ae8b2302cb168bebdd3.1539115528.git.mirq-linux@rere.qmqm.pl> References: <80a39e1a5beb7137b7112ae8b2302cb168bebdd3.1539115528.git.mirq-linux@rere.qmqm.pl> <20181009194250.GB4974@redhat.com> 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.43]); Tue, 09 Oct 2018 20:13:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 09 Oct 2018 20:13:45 +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.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH v3 2/2] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 09 Oct 2018 20:13:55 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Make cpu-usage debugging easier by naming workqueues per device. Example ps output: root 413 0.0 0.0 0 0 ? I< paź02 0:00 [kcryptd_io/253:0] root 414 0.0 0.0 0 0 ? I< paź02 0:00 [kcryptd/253:0] root 415 0.0 0.0 0 0 ? S paź02 1:10 [dmcrypt_write/253:0] root 465 0.0 0.0 0 0 ? I< paź02 0:00 [kcryptd_io/253:2] root 466 0.0 0.0 0 0 ? I< paź02 0:00 [kcryptd/253:2] root 467 0.0 0.0 0 0 ? S paź02 2:06 [dmcrypt_write/253:2] root 15359 0.2 0.0 0 0 ? I< 19:43 0:25 [kworker/u17:8-kcryptd/253:0] root 16563 0.2 0.0 0 0 ? I< 20:10 0:18 [kworker/u17:0-kcryptd/253:2] root 23205 0.1 0.0 0 0 ? I< 21:21 0:04 [kworker/u17:4-kcryptd/253:0] root 13383 0.1 0.0 0 0 ? I< 21:32 0:02 [kworker/u17:2-kcryptd/253:2] root 2610 0.1 0.0 0 0 ? I< 21:42 0:01 [kworker/u17:12-kcryptd/253:2] root 20124 0.1 0.0 0 0 ? I< 21:56 0:01 [kworker/u17:1-kcryptd/253:2] Signed-off-by: Michał Mirosław --- v2: - include dependency: dm_table_device_name() patch v3: - revive commit message - add ps example --- 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;