Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4230258imm; Wed, 30 May 2018 01:24:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKQq9XzNCHPVNNRLAS4yVqKeO4R5yaQsGEykuDoo72QVEJRERyXK2krKII/CJ7UQKcGwHcO X-Received: by 2002:a62:3b5d:: with SMTP id i90-v6mr1894598pfa.24.1527668651577; Wed, 30 May 2018 01:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527668651; cv=none; d=google.com; s=arc-20160816; b=fBdxmVkUqjy4EKVmZskkdQCDRImNsxx/9C+lGGgFp+w1Rqfk2Ga0bIoSxHfVpzp9Rh mH8yBzDkumYdA2aYgtafyUVoaqlejlkzYJmBxvMPcsw1p1hTOdt7EYJ0c6PujxgevYfi zhq36AXVtDDzxJt4ZvQXn5mnBxVty47rbLSbB5Cuuzz3m5eG7r7V3tm4qYrW6K9rLT18 mbsYX8E6J/E4ytW9bn8eF+ScKaZR9Gjoaq271Kzk0+qwrVQtMml3MjBjLUh/aVZ53aZu RvY1mQgSvg7zCO0MXaA3oBSdSDxC6xsOsssDh2uoCzpVXWN2OD2iCEwS0xdPOEtjfGEf kP9A== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=XuXcPw7dVR2/u0i9nk0oYgmKSXMZGfFaA1p4o7DsrFY=; b=gTbF7idX9jKQ02TncXc9bp/YErKBaZsbRGAspCRf+BWFuS8VLIaiw7lX/oj+b1FE+5 1Oo5xq2qZXAG25EGCcEGO/I2s19nlaXy9oHX14srW48FvE9APspU0QG4tKdwHPAP9uh4 PlbjKR8NKlEy8pLqUszRCbxgC3Bh93UZm4mxPu70RIWdNVxpJF0qMtHHFsfkiXyy8tzb Snvkn6UNV4DImY15TJWIKjV+XL7enjWnPl+MryPsZ0JBZpM1HqId9KsGO0l5+WKlO0SJ ZIeZ2q7iBqzUz8+d+xk/VGeINcrcIa+kPMxkrtnvqqTtarY4bXnNocfYN09ww9EglKhN j9MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aRjippwA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w130-v6si34898309pfd.169.2018.05.30.01.23.57; Wed, 30 May 2018 01:24:11 -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=@gmail.com header.s=20161025 header.b=aRjippwA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965041AbeE3IWs (ORCPT + 99 others); Wed, 30 May 2018 04:22:48 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53728 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935964AbeE3IWF (ORCPT ); Wed, 30 May 2018 04:22:05 -0400 Received: by mail-wm0-f66.google.com with SMTP id a67-v6so45976183wmf.3; Wed, 30 May 2018 01:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XuXcPw7dVR2/u0i9nk0oYgmKSXMZGfFaA1p4o7DsrFY=; b=aRjippwAtqQHBNjcbk068F7F/ngWSLnE7p211dr0lLMYPymeRO/OtZD+/AfvFenlTo bQCiyOcb2m1f5bCIg2fxVXmHw6HL/Sbd53gkCY3eFwG7RjPVr9PsX5tAMhS0Fv5eXMSk W17b5cS8MfbK5R06jr6T8vaEHiVn39xiBxFwqEPVdiOL745M9Szlt5t1bOytJRfW2/Xl X9vGLmE90d3idskfRibAY24WCIm1QnvLaRkF83gBber3dRts4439EhUs2krCwtSw22q3 DjhSorQjFwL5IZIGClz3yIQrGldPcYidbpDbcTiK5oWu3xKIt5seJsfos6Nt7ikl9Ptv D12w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XuXcPw7dVR2/u0i9nk0oYgmKSXMZGfFaA1p4o7DsrFY=; b=BB4pnOSGfllVlal2PFz+XF6YXrh1YKwmO1O1wnsLGzooEb+zj+gjc3DBq4lKji2cCa KG7lLTMGHXAFNgEZHP62E/vI38E8JdNUSyfpxnPgk0gemGNGotTJfB5Pwct3fLsuipDQ PkVgqDpuSZ0CU6owc/DoJAoic+GQnRfZ+HEOoTQuJQBwbJF1Q6e6waiHiKX18ddAo4rl yP7gKsv3hfNCgh8K7v9nugiJu1FK/bTL+zRPlnkUNDlcnQMFqKwjAZ1MJu7aDLTYXI7d KS6SqpAQ9TZpNfmMBzICO8pnkE3pOT6WFhHEqdGfgbE3GlSw4xGDIeAARynvNPMAzHWA KOsQ== X-Gm-Message-State: ALKqPwemLTfi2ZwAT5GCSxm1CrPeIdVQsTG4hUhNXIEatVNEKHlC0uBj TZ9bfYQwSKx8u29uOQyUCDkOjNsS7kf+2gL2GEo= X-Received: by 2002:a1c:248b:: with SMTP id k133-v6mr699142wmk.38.1527668524153; Wed, 30 May 2018 01:22:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:9e02:0:0:0:0:0 with HTTP; Wed, 30 May 2018 01:22:02 -0700 (PDT) In-Reply-To: References: <1527000509-2619-1-git-send-email-jianchao.w.wang@oracle.com> <20180522200214.GF9536@vader> From: Ming Lei Date: Wed, 30 May 2018 16:22:02 +0800 Message-ID: Subject: Re: [PATCH] block: kyber: make kyber more friendly with merging To: "jianchao.wang" Cc: Omar Sandoval , Jens Axboe , linux-block , Linux Kernel Mailing List 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 On Wed, May 23, 2018 at 9:47 AM, jianchao.wang wrote: > Hi Omar > > Thanks for your kindly response. > > On 05/23/2018 04:02 AM, Omar Sandoval wrote: >> On Tue, May 22, 2018 at 10:48:29PM +0800, Jianchao Wang wrote: >>> Currently, kyber is very unfriendly with merging. kyber depends >>> on ctx rq_list to do merging, however, most of time, it will not >>> leave any requests in ctx rq_list. This is because even if tokens >>> of one domain is used up, kyber will try to dispatch requests >>> from other domain and flush the rq_list there. >> >> That's a great catch, I totally missed this. >> >> This approach does end up duplicating a lot of code with the blk-mq core >> even after Jens' change, so I'm curious if you tried other approaches. >> One idea I had is to try the bio merge against the kqd->rqs lists. Since >> that's per-queue, the locking overhead might be too high. Alternatively, > > Yes, I used to make a patch as you say, try the bio merge against kqd->rqs directly. > The patch looks even simpler. However, because the khd->lock is needed every time > when try bio merge, there maybe high contending overhead on hkd->lock when cpu-hctx > mapping is not 1:1. > >> you could keep the software queues as-is but add our own version of >> flush_busy_ctxs() that only removes requests of the domain that we want. >> If one domain gets backed up, that might get messy with long iterations, >> though. > > Yes, I also considered this approach :) > But the long iterations on every ctx->rq_list looks really inefficient. Right, this list can be quite long if dispatch token is used up. You might try to introduce per-domain list into ctx directly, then 'none' may benefit from this change too since bio merge should be done on the per-domain list actually. Thanks, Ming Lei