Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3868488rdh; Tue, 28 Nov 2023 06:08:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdGdtm7KA0TBnQVthTqPbykrAyApBwjxVvptv8BNwPq5vPXxTQsJGXryGhu4HR+/xLyZhF X-Received: by 2002:a05:6870:468b:b0:1fa:25e4:2541 with SMTP id a11-20020a056870468b00b001fa25e42541mr12291374oap.37.1701180479942; Tue, 28 Nov 2023 06:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701180479; cv=none; d=google.com; s=arc-20160816; b=B9M+JVh2krWCsrx9KtUiN1Q8iEJpTa7ru6h84XZyrX6RqwN7x6a3QzF2kIdn/IoBn/ vRZqrd9BEheWKpJBxZqjDbZGpNT9xVPIWFOSKTsv6gFZlkJ8zchQaBsYLmfsMzYvTuDY 2I3VIYFCzQxE7tGlvFT2AHsHsJ/I3CcNgCeRxdq4jw82WIrqSKPz0QqHafU2c4J/O/c9 Qxl2F6wEljRrD05QzR+4ep9EdwTf8BWZpgchbcDxyFXzfMOZaXcR3qm5c621mC0ge/Vh lolHwgn6xq4El5D7Wz20m9YqxzUtk4kRvWqrpDtD6KgFM6WHBrADQvDYCb9ni81rY28M PEKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=fQxu/Q+/3YRfoin23/gnMqXUeIr+YHYWByn9KpCUiOo=; fh=S6bHeu/WbiFQFbGjGYAoNXxtGz2zhuLLBMaoqbOSDNM=; b=uGdvBYI+qXnNLhEmCDJpEJirMvrc+gvRA3JqziX0IZ9H04cojlEa3tWQ6dtWsEOfN/ t4yLuMzAhprLFjImITC9JBLY3P5hroD6qlL9swy4GD78NZa9zTSpUr4ZfczQ2n+VZC6K vVi44GOad6j6F/RTLkJ8dQ+xdI/Qwsn8n/MY/qoH9aJkk1JB+5eluIrLnWYpha9i8EbV 4KOsbEtqUxWX6SZH7VGI/I34EVc8bsP49OuLMGDVrX5UqdlRyNVdVYELxD7nwmbFrmHA M0MrTg4SsA4m2Oid51HCIpd9HwXiVAREx3hc2TfgUD+RqWbiIlBf94ycWmKiG4uMtXLJ L4Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZzJbNQEk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id hc10-20020a056870788a00b001fa5ad18baasi1617960oab.301.2023.11.28.06.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:07:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZzJbNQEk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DF2A08051B34; Tue, 28 Nov 2023 06:07:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345543AbjK1OHc (ORCPT + 99 others); Tue, 28 Nov 2023 09:07:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345537AbjK1OHa (ORCPT ); Tue, 28 Nov 2023 09:07:30 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97BA5D64 for ; Tue, 28 Nov 2023 06:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701180455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fQxu/Q+/3YRfoin23/gnMqXUeIr+YHYWByn9KpCUiOo=; b=ZzJbNQEktvBMAUTM0CuqT1zVRmyLGGtGhgSwGYJ9lPKw2RBU890RHL7nVL83vM18zExOB6 ivtKSZvgw1E//qMusjK7Tr2lzPlTolPke5P+rR+CYscoPvpv81or5oJxg8m/IHKHtKeDZt 6hlw5f/RxHrZNbxUx7gIgr7dGnK7Alk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-iwcpNMSPMTaHQiZc-nN-HA-1; Tue, 28 Nov 2023 09:07:30 -0500 X-MC-Unique: iwcpNMSPMTaHQiZc-nN-HA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB44A101A53B; Tue, 28 Nov 2023 14:07:29 +0000 (UTC) Received: from file1-rdu.file-001.prod.rdu2.dc.redhat.com (unknown [10.11.5.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3A71502A; Tue, 28 Nov 2023 14:07:29 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id 90D0330C1A8C; Tue, 28 Nov 2023 14:07:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id 8E2303FB76; Tue, 28 Nov 2023 15:07:29 +0100 (CET) Date: Tue, 28 Nov 2023 15:07:29 +0100 (CET) From: Mikulas Patocka To: Yunlong Xing cc: agk@redhat.com, snitzer@kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, yibin.ding@unisoc.com, hongyu.jin@unisoc.com, dongliang.cui@unisoc.com, xiuhong.wang@unisoc.com Subject: Re: [PATCH] dm: increase the io priority of the kworker-kverityd process In-Reply-To: <20231128094414.583666-1-yunlong.xing@unisoc.com> Message-ID: <83e8ea6c-1d9-36d5-1c23-da686dbfaf80@redhat.com> References: <20231128094414.583666-1-yunlong.xing@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 28 Nov 2023 06:07:52 -0800 (PST) Hi This isn't correct - the workqueue process is reused by multiple work items - from dm-verity as well as from other subsystems - so you would be unexpectedly boosting priority of other tasks. The correct solution would be to set the ioprio field of the outcoming bios in dm-bufio explicitely. Mikulas On Tue, 28 Nov 2023, Yunlong Xing wrote: > From: Hongyu Jin > > When obtaining the hash value of a high IO priority data block > from the disk, the kverity-worker that obtains the hash will > also have a high IO priority to avoid being blocked by other > IO with low IO priority. > > Signed-off-by: Hongyu Jin > Signed-off-by: Yibin Ding > --- > drivers/md/dm-verity-target.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c > index e115fcfe723c..ade9c6734154 100644 > --- a/drivers/md/dm-verity-target.c > +++ b/drivers/md/dm-verity-target.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > > #define DM_MSG_PREFIX "verity" > > @@ -639,7 +640,9 @@ static void verity_finish_io(struct dm_verity_io *io, blk_status_t status) > static void verity_work(struct work_struct *w) > { > struct dm_verity_io *io = container_of(w, struct dm_verity_io, work); > + struct bio *bio = dm_bio_from_per_bio_data(io, io->v->ti->per_io_data_size); > > + set_task_ioprio(current, bio->bi_ioprio); > io->in_tasklet = false; > > verity_fec_init_io(io); > -- > 2.25.1 > >