Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6196755imu; Tue, 13 Nov 2018 19:39:14 -0800 (PST) X-Google-Smtp-Source: AJdET5f/6Jm2+o0OSelvCfj+xSyidbk3dRnznJ0gjSmwUw3fm1CYim2V2QbalE/qdDYSILGzmWSj X-Received: by 2002:a17:902:244:: with SMTP id 62-v6mr280624plc.280.1542166754085; Tue, 13 Nov 2018 19:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542166754; cv=none; d=google.com; s=arc-20160816; b=luw/H7FXY2qkZgFmoyadarNWaDZzYbifNmOjm8bIgWUZFqjVzpFcXPJsSNjN+rUE1G ROcuPruORSH8gfwxBKoCabw7m5C3PbeYHSeyOhRCnnDwv52OppFU3ItIV0GrkXOnWwsL t89OU8IUglxwy4X4kgbPAoOkv4POVNJVBiF1DjhjVjsLT7mQxA6WtI2gdaVWob1ftkJr /2Amcxdd/BRl+g5RcJ2ihivp0bcS3Cpufe3ItNBz9XvUY4dtRAyDKYGRR1dGs0z0K0iN 5dR1YhK9Ga5qi9InNBD4VnvMi1V9JQ7Bg4t7AgB1OahwnQgxorsFDOwcdbwi+cEJWbE4 LNfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=b9ipmtCfv1pNq29VRYkspuamivSv3RhE9u3kWwbQcwg=; b=IRZRyYnIuQ/UfdtYPs/bI0e9ju0huFoGX73Rb3EkYQidwHQiCGEJ5ZuwLrtT89C4Po jMhMIJz63YR3gQ3IysqXKz9I2Gq4ZgqJoSZVvterKpgKseDf3t1sNvChPKNUqpGA/fzI Mb5QiN70pJDEEdFwTmDCyiAkuek2IzlujEGmKzzuHbMQ/CXNjx+2SF6tJbnw5G/+s7vo tp+4PDn67NVFvPqyAspexelw9VwTqCx/Zh2g2BUg5W/sV0dN2+nZodZQfYs96SyxfiTz 66iy2rdmXIdOGFLBMjcByhWdBNKkqYDyQ3ZnZ/HYTs5SXVqgf79dxZiA1DCYEIx5rldX vxOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=It8YIZzm; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si196948plb.214.2018.11.13.19.38.46; Tue, 13 Nov 2018 19:39:14 -0800 (PST) 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=@oracle.com header.s=corp-2018-07-02 header.b=It8YIZzm; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731813AbeKNNjg (ORCPT + 99 others); Wed, 14 Nov 2018 08:39:36 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:40586 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbeKNNjf (ORCPT ); Wed, 14 Nov 2018 08:39:35 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAE3Z38R097054; Wed, 14 Nov 2018 03:38:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=b9ipmtCfv1pNq29VRYkspuamivSv3RhE9u3kWwbQcwg=; b=It8YIZzmrh+hC/Itn/td8AktLRp69FT4yTevDtlZ1aF+VR62dDZh88hxeuBrw+qrjUbs GJ/i4U/S56IpqYEAGa59H0HRaRii5fgBc20a8grtXXKu4W9HQo3cWizGZLxtefL1ztA6 X4xICukowB7UKyLvrrROaJr9WPDYDYYIX4rX3vxlfhSS8Cd6a7CSaUvKuJNTAAVsXGpk lvN0KrQwEVz/ZLkyQz2Ks/TcrmYd8ePn5jG+GdjvMSYdlT7RI4x5C4S/RQp7tw/oAlTa +MejTyQVcVH0BlslDwX5Cfwzy5CbBzp2MGG2yKpM1i7G5BP4vJNQf9ybJfOnqDCMw12Q /A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2nr7cs0v3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Nov 2018 03:38:11 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAE3cBZB029341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Nov 2018 03:38:11 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wAE3cAmZ029524; Wed, 14 Nov 2018 03:38:10 GMT Received: from [10.182.71.8] (/10.182.71.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 13 Nov 2018 19:38:10 -0800 Subject: Re: [PATCH V6 3/5] blk-mq: ensure hctx to be ran on mapped cpu when issue directly To: Ming Lei Cc: Jens Axboe , Ming Lei , linux-block , Linux Kernel Mailing List References: <1542103016-21037-1-git-send-email-jianchao.w.wang@oracle.com> <1542103016-21037-4-git-send-email-jianchao.w.wang@oracle.com> <94ec3d97-f75f-645d-94f1-24d3fd476940@oracle.com> From: "jianchao.wang" Message-ID: <6fa5f24c-727a-5d20-7677-da4ac3e173f9@oracle.com> Date: Wed, 14 Nov 2018 11:38:16 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9076 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811140031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14/18 11:02 AM, Ming Lei wrote: > On Wed, Nov 14, 2018 at 10:15 AM jianchao.wang > wrote: >> >> Hi Jens >> >> Thanks for your kindly response. >> >> On 11/13/18 9:44 PM, Jens Axboe wrote: >>> On 11/13/18 2:56 AM, Jianchao Wang wrote: >>>> When issue request directly and the task is migrated out of the >>>> original cpu where it allocates request, hctx could be ran on >>>> the cpu where it is not mapped. >>>> To fix this, >>>> - insert the request forcibly if BLK_MQ_F_BLOCKING is set. >>>> - check whether the current is mapped to the hctx, if not, insert >>>> forcibly. >>>> - invoke __blk_mq_issue_directly under preemption disabled. >>> >>> I'm not too crazy about this one, adding a get/put_cpu() in the hot >>> path, and a cpumask test. The fact is that most/no drivers care >>> about strict placement. We always try to do so, if convenient, >>> since it's faster, but this seems to be doing the opposite. >>> >>> I'd be more inclined to have a driver flag if it needs guaranteed >>> placement, using one an ops BLK_MQ_F_STRICT_CPU flag or similar. >>> >>> What do you think? >>> >> >> I'd inclined blk-mq should comply with a unified rule, no matter the >> issuing directly path or inserting one. Then blk-mq would have a simpler >> model. And also this guarantee could be a little good for drivers, >> especially the case where cpu and hw queue mapping is 1:1. > > I guess it is quite hard to respect this rule 100%, such as in case of > CPU hotplug. > Yes, it is indeed the case. Looks like this patch is contentious. I will drop this one and post later as a standalone one if necessary. Thanks Jianchao