From patchwork Tue Oct 9 19:27:34 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: 10633203 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 D9C3413BB for ; Tue, 9 Oct 2018 19:27:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C717E2970B for ; Tue, 9 Oct 2018 19:27:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B696F29712; Tue, 9 Oct 2018 19:27:55 +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 A07B02970B for ; Tue, 9 Oct 2018 19:27:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CFE5C058CB9; Tue, 9 Oct 2018 19:27:52 +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 5BD167C811; Tue, 9 Oct 2018 19:27:50 +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 BB2B14BB79; Tue, 9 Oct 2018 19:27:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w99JRhU2025800 for ; Tue, 9 Oct 2018 15:27:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id CAD8E51FD; Tue, 9 Oct 2018 19:27:43 +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 02C6951DC; Tue, 9 Oct 2018 19:27:39 +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 04CA17D84D; Tue, 9 Oct 2018 19:27:39 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42V6fy3HGNz1D; Tue, 9 Oct 2018 21:26:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1539113210; bh=49cIa56Y1TlTohH4ugX4KvoY6k8aNbayjFY8IvqG5l4=; h=Date:From:Subject:To:Cc:From; b=SmcqfLhHyxs/zScHiqMKo5ESlKG99clYfol2WbDR+FhNe+mDz5M7IOsDBxCAzshLg ZZPL+8U5WokwL45UuGBTYXIcU7r4KLvAYOe1yCnPlz840KDP/STxH3s4ce3Tsd6MVM oqqsWB6tVcQxXPdxLT8iXQjBuIomRtinvl6V1ZNznp7LFCRH2d5B44rjwxb96+tsq5 61QZfHoWDtSsAGu+py0Ut2/ArmMEBa+ZalFpfcGJK8vOX/jUscBmP44hfVkE6an/qs zAe3fJjt7PcLdcKDZJTukWoigBBDS516OGGRyLpz89tNKpTshKX3KjM2XD90VDvv5o uvHpymTl4T6PQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.1 at mail Date: Tue, 09 Oct 2018 21:27:34 +0200 Message-Id: <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.2]); Tue, 09 Oct 2018 19:27:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 09 Oct 2018 19:27:39 +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.79 on 10.11.54.5 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 09 Oct 2018 19:27:53 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Make cpu-usage debugging easier by naming workqueues per device. Signed-off-by: Michał Mirosław --- * Against v4.19-rc4 --- 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;