Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp526512lqp; Wed, 22 May 2024 11:14:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIQ78z/K4Bam2Ugwe489r90ss6Z3esOCQtx2wIfaTBBbnMhvHTf1npT1yJ8/G8M+WvslMQGUlsy92JngCWLR5xbqM0pN3HaO2XlS+c/w== X-Google-Smtp-Source: AGHT+IFcXqJ3FnhA3ASxo6MUBmsmIV410n/Tjn57TzePbnns3yO/z3fvuy7E0aSiFOC6ZL5dvQSH X-Received: by 2002:a17:902:f60a:b0:1f3:2f95:ec8d with SMTP id d9443c01a7336-1f339e34806mr1151955ad.0.1716401646622; Wed, 22 May 2024 11:14:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716401646; cv=pass; d=google.com; s=arc-20160816; b=d884by69qgJIyiEetbV3NOoa3ojVgOXWt2pAdJneLHtalMBF2su6EkeLDmVe5tEIRz uC445or/VLZisPlTw9dxUIzCpyC4u3hM4wBuMKUP6hUQ6fGPRnqA9RJJ/OHAtiZV09xv gfSgR0k8jqC1JdLFSnp+AUaRjy5HlREuH27T7sVfAi00ctNQpFFlU/0cEu3LIZmY3trS l84uholxYLgY7e5UIOqBbTOmMuVJ3bmKjNLwncFl5FdjfOK2dOtsl6Et40WM5D8CrUHP bxsE/reXM44beYct5bBMtK18RPSQfHpDOIwzVza+bwWsz07y/MjQG7kDNqV6Zo84TulF 11vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tGhFk+6Mn+aFTeEhhRU2V2oXQp27/bTpuMCUZ0uMfqc=; fh=TjVa9WgSz4pq6tpJy6dDaqIk1r271wHp0TyN/qaXkWY=; b=SkycUFHBle9zcDU7iU63cK2hnDayML1+sdmQJiDQONxYMvxnBEyt1rn+8+SNY8pCBT TutfE56UF6EIztkjmif2b4pUNlyDvhc0pNxWurUGyea35FbADBQR2wHkdyNm7zt219ZQ 5tzVQPG0J763/wxCH98eiUyJeus6DzLMpfc5h+qrkXQ+4TbRfpXJYw62tcKDPRxAooGy 4LeOuKHz21POgiKZnauIrM23RJny7UFyElmjoBwRGF5WiODZtunJzUugLM+jzq73+xfQ j/ZAzwB+IXgBk7ks1NSQSYocuGPaNUY/a53FtVY7POH5bSfpJ38beYoq9Bt4aZaIvSr2 r2OQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=sDFdTlS8; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-186603-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186603-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f69c4d4503si168300b3a.394.2024.05.22.11.14.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 11:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186603-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=sDFdTlS8; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-186603-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186603-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 446C928135C for ; Wed, 22 May 2024 18:14:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50C78145B13; Wed, 22 May 2024 18:14:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="sDFdTlS8" Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3658AA929 for ; Wed, 22 May 2024 18:13:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716401639; cv=none; b=uu7pjbCZlQ0OSHRiwjtnhIZAAXMn425G55CGj6aF6qj7yl4Lpw54aWXwiMshXsMbeGXy6axUZC7/hOL8y6AL8aITPj9W0m88xIpinqtToW4T0HxXTw1o2sm6Gxnf7CGUXlhS5AUMreZURNGivIQIK/pBns/8+4KJZI7aIa0vsNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716401639; c=relaxed/simple; bh=5NMsDfY6VTABrDzPgIWhs/3DIYKZtHGT8JJUJOlXrjE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OJiNHIF0ujwR29Fsk6BW8vdgHCRgrwn/Wl3iKlbGHgxlmDOHQPClgCpYJZEE8zjHGJeW1bURappas6c2S7/Iw4o4hXwzVFT2flomulqpzO/X5IEL1eDV6X/4s3C4H5Uu7H2HOK09RBUal45S9jy0x42be+VEhYp/349uvNFwVTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=sDFdTlS8; arc=none smtp.client-ip=209.85.166.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-36d92f4e553so2570675ab.3 for ; Wed, 22 May 2024 11:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1716401636; x=1717006436; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tGhFk+6Mn+aFTeEhhRU2V2oXQp27/bTpuMCUZ0uMfqc=; b=sDFdTlS8EOzGAOHHLTGwbBbK8QPgMUI1LZJ/aFXTmJNHuh4Dhj0rEeTGzYW723BxQl jgVZS00+3VaDoeFk3sCytEgvFrDBeqo8PntiCMXpDT+ybg0X3SGpO414j1ejYz5KX7es 6ZG+NisAD20kc4hPuuA+F9f4tHIkPDwHEH1yWpRfd6wKhjp4xjLs1E4MjtVnzsMd6L38 z2Pk6QaNvnWl/69X1IRe+Iuj+oLH5uNbp7saNfsltDLwIMgcYfjG4dMX9/hCrHmClCAB NK1yG/BKHJipV3iu6HuPf5EeANiqFALYgLQp2mO6sXR2nZQ3YrsHnfqh5/M7uCyRhu97 Sbig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716401636; x=1717006436; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tGhFk+6Mn+aFTeEhhRU2V2oXQp27/bTpuMCUZ0uMfqc=; b=buaTsA4bSE7XkWNw1zCEMDik+utNhiqepmJ+WTMSIcw9KHoZ1bazF5O9bC1JXYxRWA 7IuRkG5IX++79oKrogSuImLKQjxgGU0xUr/l8Ho0ZR64AzrJOvzF4ckuAjaHgu2jWkSl kLZmOpTclaZneRb+h/9iH3QPyBOqJ4R8DHkBHgq1CpTSWJWMyXKvyIxYiqFwgkP6Ikum Wn+HMGWtPJNg/SMbndS0r5L6av6HzURXCUHs3h9JOsujVcdj5gXkfFmw7eIdDcMGpuBH 9GdcDBEjfJqSYmrqUwYcToOqrCgsrEteDgFz6S29fMV3VKbp1wSUUedVmT3N4Via9Bjy Q76w== X-Forwarded-Encrypted: i=1; AJvYcCVGFiKIZjDPONwBz5GKiAq5i3muCywn2Xl8mUSOaRDS8b0o6drH6VXGQS7pMpXzlo1Z6zSaHHUFkrRQX8JXEtQG0Ecokqotj9LvsBOE X-Gm-Message-State: AOJu0Yza1xRJjAU6JGy7SKYGYwWDQ2yXjZG9HK+GMv1zixxq01dF94fs 5/iKu3LGAiJPsf6nOMrlARZf1p3DcTx+ay4xR69a62f7eAYbkorDOTm6K/0GNUQ= X-Received: by 2002:a5e:cb03:0:b0:7e1:d865:e700 with SMTP id ca18e2360f4ac-7e38b2004fbmr306212539f.2.1716401636350; Wed, 22 May 2024 11:13:56 -0700 (PDT) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-489376dc51esm7796324173.122.2024.05.22.11.13.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 May 2024 11:13:55 -0700 (PDT) Message-ID: Date: Wed, 22 May 2024 12:13:53 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] loop: inherit the ioprio in loop woker thread To: Bart Van Assche , Yunlong Xing , yunlongxing23@gmail.com, niuzhiguo84@gmail.com, Hao_hao.Wang@unisoc.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240522074829.1750204-1-yunlong.xing@unisoc.com> <5166bc31-1fd9-4f7f-bc51-f1f50d9d5483@acm.org> <68cfbc08-6d39-4bc6-854d-5df0c94dbfd4@kernel.dk> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/22/24 12:12 PM, Bart Van Assche wrote: > On 5/22/24 10:57, Jens Axboe wrote: >> On 5/22/24 11:38 AM, Bart Van Assche wrote: >>> On 5/22/24 00:48, Yunlong Xing wrote: >>>> @@ -1913,6 +1921,10 @@ static void loop_handle_cmd(struct loop_cmd *cmd) >>>> set_active_memcg(old_memcg); >>>> css_put(cmd_memcg_css); >>>> } >>>> + >>>> + if (ori_ioprio != cmd_ioprio) >>>> + set_task_ioprio(current, ori_ioprio); >>>> + >>>> failed: >>>> /* complete non-aio request */ >>>> if (!use_aio || ret) { >>> >>> Does adding this call in the hot path have a measurable performance impact? >> >> It's loop, I would not be concerned with overhead. But it does look pretty >> bogus to modify the task ioprio from here. > > Hi Jens, > > Maybe Yunlong uses that call to pass the I/O priority to the I/O submitter? > > I think that it is easy to pass the I/O priority to the kiocb submitted by > lo_rw_aio() without calling set_task_ioprio(). Yeah that was my point, it's both the completely wrong way to do it, nor is it a sane way to do it. If the current stack off that doesn't allow priority to be passed, then that work would need to be done first. -- Jens Axboe