Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5533513yba; Mon, 13 May 2019 12:32:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxI+KoD9JB3BuoR9uQkpCn3JHG4mmj0o9LhtLNv8kWJdNCT0hVYqw9/4oxEzxbmkqV5rZUF X-Received: by 2002:a62:6d47:: with SMTP id i68mr35989414pfc.189.1557775978641; Mon, 13 May 2019 12:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557775978; cv=none; d=google.com; s=arc-20160816; b=M2ZUxNCYtoHkq3culopc4QGD+n6ObCXTz2KCKECHkz5du3mULo4s7y/T8909M9xb+O BK09NTG351Fmv/94x2pYllJnudRSgMo7V3hVvZLj+bOyM3V4JKQhCJZxJ8evKire5RCo 63KZi4o5ihH0+9KCGmsz96LU5S+wnJWr8TrX/Fd7EFKFphzxO+U46YdP/FpZ9rNnaFxb GIFXq/pENmlMFSnZs6agj0yRfiBQHKIewTn/Usd9ioaGhFmMCvkp7tKvkmNC8qpKSBe+ UeLJTfDbxTk+ggjGHS3csBRt/EhO2YrmPhvPfzX1ckkx3iHmyHKNPkfJiL1ik78LT3Yx ctHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/FGCwLTtsPou6WCnYmFWjFgDVwYGnmOLqmgUgKfSYFc=; b=NyvwknLiSsaoxxkwswVLxXsN3iHUi1XPYC7MJqDDQZq14WaW8Zcp0eHXT98GYqrJeX 7htCpgvWSmWU8SnwmHtPbp/fVOwXDd6aZHt/z4btzw3/TEUGjsR5lqXqMk+pmsLrJW4q mGBFTVBHI9+t03tH1xdINCfIaX1LsfCUZ7i6NXcytpe+rwj1Q1l6FDTn8sMlJULgdEVf 7ycFCjm4pgOzHN654fCSAtnIFCIzIJ+zcoLeomEabPl+Dn5bWNr9Evfd6acuIOoO9RLP ntPKdfsAi5n13BvLZc/LxF03/dRw2wmIyGRv4laG0AZYzURQFAw0rvy/i9NAxn/nmhZ3 G7ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k186si22063295pfc.189.2019.05.13.12.32.42; Mon, 13 May 2019 12:32:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731329AbfEMRPY (ORCPT + 99 others); Mon, 13 May 2019 13:15:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48390 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729688AbfEMRPY (ORCPT ); Mon, 13 May 2019 13:15:24 -0400 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 75EA33087945; Mon, 13 May 2019 17:15:23 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95F3F18E51; Mon, 13 May 2019 17:15:20 +0000 (UTC) Date: Mon, 13 May 2019 13:15:19 -0400 From: Mike Snitzer To: Doug Anderson Cc: Tim Murray , Guenter Roeck , Enric Balletbo i Serra , Vito Caputo , LKML , dm-devel@redhat.com, tj@kernel.org Subject: Re: Problems caused by dm crypt: use WQ_HIGHPRI for the IO and crypt workqueues Message-ID: <20190513171519.GA26166@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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.45]); Mon, 13 May 2019 17:15:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13 2019 at 12:18pm -0400, Doug Anderson wrote: > Hi, > > I wanted to jump on the bandwagon of people reporting problems with > commit a1b89132dc4f ("dm crypt: use WQ_HIGHPRI for the IO and crypt > workqueues"). > > Specifically I've been tracking down communication errors when talking > to our Embedded Controller (EC) over SPI. I found that communication > errors happened _much_ more frequently on newer kernels than older > ones. Using ftrace I managed to track the problem down to the dm > crypt patch. ...and, indeed, reverting that patch gets rid of the > vast majority of my errors. > > If you want to see the ftrace of my high priority worker getting > blocked for 7.5 ms, you can see: > > https://bugs.chromium.org/p/chromium/issues/attachmentText?aid=392715 > > > In my case I'm looking at solving my problems by bumping the CrOS EC > transfers fully up to real time priority. ...but given that there are > other reports of problems with the dm-crypt priority (notably I found > https://bugzilla.kernel.org/show_bug.cgi?id=199857) maybe we should > also come up with a different solution for dm-crypt? > And chance you can test how behaviour changes if you remove WQ_CPU_INTENSIVE? e.g.: diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 692cddf3fe2a..c97d5d807311 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2827,8 +2827,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) ret = -ENOMEM; cc->io_queue = alloc_workqueue("kcryptd_io/%s", - WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, - 1, devname); + WQ_HIGHPRI | WQ_MEM_RECLAIM, 1, devname); if (!cc->io_queue) { ti->error = "Couldn't create kcryptd io queue"; goto bad; @@ -2836,11 +2835,10 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags)) cc->crypt_queue = alloc_workqueue("kcryptd/%s", - WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, - 1, devname); + WQ_HIGHPRI | WQ_MEM_RECLAIM, 1, devname); else cc->crypt_queue = alloc_workqueue("kcryptd/%s", - WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND, + WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, num_online_cpus(), devname); if (!cc->crypt_queue) { ti->error = "Couldn't create kcryptd queue";