Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6859295yba; Tue, 14 May 2019 15:14:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFRwz6r7GkmrrszS4+1KZR5GOQlpRhaA6Cb9ZIFLy1J7/mZBbP/+jqVl80i8iMAN9j8VyC X-Received: by 2002:a63:d4c:: with SMTP id 12mr27097551pgn.30.1557872069165; Tue, 14 May 2019 15:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557872069; cv=none; d=google.com; s=arc-20160816; b=VoxbloHpz/RtvuxDbgdwfGVHS4EsgSnXli2XNs+84XG9nAfyupMdFkAFBrzohDbLnm cJKdWF8FAjdhiDUiqY6yCVCrlEolxCQZVkX0kjk3Ud0ojn1YZkcE4V/DLkd/XpYaFrzW LO/A9X0PFObY+qcaM4F3a+K4dYn97Ot1petZbE4ueIDh+sA2CAY+mMQetngPji03fR1r PA+5ZvbMu7YLahu+v/3z5OyuqfzLilBT3G6MxU/snyFZvjCoqShvssOoLxICDTy74UlU DrR94ofdm/AVKXqXD3kIDjEmiVI7YR2x1LFjwGznunJud53r3Ipd4x1CDmqQmM+li/Wg 9M4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wVIzeix7iLELUYXl5m49E5wdhPumzJ5vp2cjgvebQJQ=; b=xS6xMqthEsf1ikpqY4qW4OP8NbvlW5BoW5LWwMUzdJqqVl6ll+yO76zAb2Zf9PtsH+ RjB6Dcg/Md16CUtKhs+Fx8TaMdRLNmCbSLlHlN5tJ8fawTylauUHAqz2umtIlWruR0it kB/WN7+TYu0mWjwPYkLbcP/hn3a653V8cHMpnfY/az1TJq6oJjZ+Yew/rSZimVfNoLGg rDi7EsuG7z1u/iuHBdFaD0JiRe/wlvlVJi/lRBKTrk36Tql03SNPNm91DmgvLgytKQfu caf/RgQZmRlnlyxLF+wuKv74ccmz7RQC+AWnz1iP5HsSNPzr7mjML8l8Jj9UVExUouxr 8qLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ULnWl7Re; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si49274pgm.455.2019.05.14.15.14.08; Tue, 14 May 2019 15:14:29 -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; dkim=pass header.i=@chromium.org header.s=google header.b=ULnWl7Re; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbfENWND (ORCPT + 99 others); Tue, 14 May 2019 18:13:03 -0400 Received: from mail-vs1-f54.google.com ([209.85.217.54]:43933 "EHLO mail-vs1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbfENWNC (ORCPT ); Tue, 14 May 2019 18:13:02 -0400 Received: by mail-vs1-f54.google.com with SMTP id d128so355522vsc.10 for ; Tue, 14 May 2019 15:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wVIzeix7iLELUYXl5m49E5wdhPumzJ5vp2cjgvebQJQ=; b=ULnWl7ReV9rhaVd9pYIsvgg33E+PGKtMfc+ur2c8hcDVjhewK0cqzVQ/57ij9VsgjQ 5Y69oZ7Mzh9fQPFmr2uXOzsFsmL/k9mCx144O+AehmgtTh59VxK83LKZqOWIeKnin8wQ 0IIZse0BJQXufZcusH2jn6JvGYIO8IsvjbGNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wVIzeix7iLELUYXl5m49E5wdhPumzJ5vp2cjgvebQJQ=; b=ibbIFx56Fx2ZJzdOvYsQody+lflnBZ3oI3iJg8xEN6NXSQvRFAlMSJibZUSWYQzH9S MZRKLmu8+7MR6fGuh4Pp76MtsBb5r+V748BIk834WPtd9FUtvuxwGF4j3mOYATVIfN1W p17NVtKTQYieWOWRv+h5Rg24/R44j5cIjU+AkybM2FUtSR3bcRvczCmKvLHyEQne5jYj 8B86m+mm2ROWDxZSOU5HKdP/AdnxQAq+270jWGvMNe6Sz4+Y1qHrnN8Bh3nevJJqG2R4 cVIUKcX5kSe+syy4LBkc3w+UVeduA6lRYbdroGThDG+xuvZHwNcLidoxUEz7IKHPBrji i7iw== X-Gm-Message-State: APjAAAV1p2OlKXD7agNWTsnWZJbUhRWo0D+xlq2TyqHyOdmfh/CBYEFQ lXUQChEvdm2MvMHW42MDVs52S15Wskw= X-Received: by 2002:a67:7ac9:: with SMTP id v192mr19336729vsc.100.1557871981559; Tue, 14 May 2019 15:13:01 -0700 (PDT) Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com. [209.85.217.45]) by smtp.gmail.com with ESMTPSA id e76sm69036vke.54.2019.05.14.15.13.00 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 15:13:00 -0700 (PDT) Received: by mail-vs1-f45.google.com with SMTP id o10so349867vsp.12 for ; Tue, 14 May 2019 15:13:00 -0700 (PDT) X-Received: by 2002:a67:b348:: with SMTP id b8mr10745210vsm.144.1557871980393; Tue, 14 May 2019 15:13:00 -0700 (PDT) MIME-Version: 1.0 References: <20190513171519.GA26166@redhat.com> <20190514172938.GA31835@redhat.com> In-Reply-To: <20190514172938.GA31835@redhat.com> From: Doug Anderson Date: Tue, 14 May 2019 15:12:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Problems caused by dm crypt: use WQ_HIGHPRI for the IO and crypt workqueues To: Mike Snitzer Cc: Tim Murray , Guenter Roeck , Enric Balletbo i Serra , Vito Caputo , LKML , dm-devel@redhat.com, Tejun Heo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, May 14, 2019 at 10:29 AM Mike Snitzer wrote: > > tl;dr: High priority (even without CPU_INTENSIVE) definitely causes > > interference with my high priority work starving it for > 8 ms, but > > dm-crypt isn't unique here--loopback devices also have problems. > > Well I read it all ;) > > I don't have a commit 37a186225a0c, the original commit in querstion is > a1b89132dc4 right? commit 37a186225a0c ("platform/chrome: cros_ec_spi: Transfer messages at high priority") is only really relevant to my particular test case of using cros_ec to reproduce the problem. > But I think we need a deeper understanding from workqueue maintainers on > what the right way forward is here. I cc'd Tejun in my previous reply > but IIRC he no longer looks after the workqueue code. > > I think it'd be good for you to work with the original author of commit > a1b89132dc4 (Tim, on cc) to see if you can reach consensus on what works > for both of your requirements. Basically what I decided in the end was that the workqueue code didn't offer enough flexibility in terms of priorities. To get realtime priority I needed to fallback to using kthread_create_worker() to create my worker. Presumably if you want something nicer than the "min_nice" priority you get with the high priority workqueue flag then you'd have to do something similar (but moving in the opposite direction). > Given 7 above, if your new "cros_ec at realtime" series fixes it.. ship > it? Yeah, that's the plan. Right now I have but Guenter pointed out some embarrassing bugs in my patch so I'll post up a v4 tomorrow. I pointed to a Chrome OS review that has a preview of my v4 if you for some reason can't wait. That can be found at . -Doug