Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3657011pxb; Mon, 1 Feb 2021 00:47:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPvgGc7CHb7p+9Yy8zGDDAcuBWYraaPf6C0un2LSnKqBlbqSLcE3RhEj3/7wHFAfxqfeNR X-Received: by 2002:a05:6402:190a:: with SMTP id e10mr17798354edz.110.1612169268563; Mon, 01 Feb 2021 00:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612169268; cv=none; d=google.com; s=arc-20160816; b=QN/NUY33IwG/s/TZ6kvx5SYBbykwWGTmnEsIl4tFXOFexgY5eI4Nr0JhZsm/oC+k1j bFRQPVF2Omx34EyUI3HFGQNZokgzjOX5NbuRYV2bt2rzxSdJi8djuHAhtUtRzrlw27PE xi1kXMu/eeHqNsf8m2C3O9wDYoDFn2ejgJ1BHftVM32l3kyfj65x6hu5WsdjAmrZ3YXi QbFn5X0G9QZb46GwnFSSoRZFIbEfjFJfgy24xFlrysyFeeGzF4n/Nk4vEt70kjK/i121 mnJmTzpVqH+vIp8qBJVM6yLT5F3AY/NpU+NtzTeQ3I4iBNQ7nMY75C3LSg+pDdDw74cG phFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jkQZ1jYG50+X7NaAMSJJsC7otPVlH+wE/Z7dwYk2CWo=; b=FgWR/OevcBhBCv5+OR4VDCl2+e9rqyaEU+qzfIOgPPR1Dr8VYyq6NfKbqPRtKcUkky +433laFHxD8ywEKl4NhTBVRnci+Qstgy47iaa23sxfJW/vQAihr4rVFPY+o/s97iWA9l KpcJHGXrVTvy63IfqTCsqe0Pt//b+++zojmzhQCwZoCQamZfwfZ5zWx9KHfSGBXRK4p4 tgY9bjXnltPl+KuN/SjH9u7TWZun4ki5+ErxMPrBdcjLf7pqi8FpDBEya7wREHzcyVPN g4bnmd3OKF8YJkfWuoxi0awwi4ybcwAz+ifDrEd6qmkd2+CRBTgHMR3+Zo3grp3eeJAF u3UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kd2PZHj4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gq19si10122182ejb.623.2021.02.01.00.47.23; Mon, 01 Feb 2021 00:47:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kd2PZHj4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbhBAIpF (ORCPT + 99 others); Mon, 1 Feb 2021 03:45:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:46780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbhBAIpD (ORCPT ); Mon, 1 Feb 2021 03:45:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3825164E33; Mon, 1 Feb 2021 08:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612169062; bh=zVmeZjSKPYgQEaLUS6EY0CKKZiQUZErvhF5byvqvT9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kd2PZHj4xQK0mXTWKDAAp3yKTqd52zZj9zgMyJK6iTCz4JyXgPCST/gYsPYWfN4yl 3AQMd0qvT+OGifw2/hyZUowy8hjyDCGQH0RBQYInyWnp9iCB7AjNI1nuBCHndjrVnq 3n8svPXM6fDw0N2q0Rokam3YohMy5TjRUrULEfwI= Date: Mon, 1 Feb 2021 09:44:18 +0100 From: "gregkh@linuxfoundation.org" To: Avri Altman Cc: "daejun7.park@samsung.com" , "James E . J . Bottomley" , "Martin K . Petersen" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Bart Van Assche , yongmyung lee , ALIM AKHTAR , "asutoshd@codeaurora.org" , Zang Leigang , Avi Shchislowski , Bean Huo , "cang@codeaurora.org" , "stanley.chu@mediatek.com" Subject: Re: [PATCH 3/8] scsi: ufshpb: Add region's reads counter Message-ID: References: <20210127151217.24760-4-avri.altman@wdc.com> <20210127151217.24760-1-avri.altman@wdc.com> <1891546521.01612153501819.JavaMail.epsvc@epcpadp3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 08:17:59AM +0000, Avri Altman wrote: > > > > On Mon, Feb 01, 2021 at 07:51:19AM +0000, Avri Altman wrote: > > > > > > > > On Mon, Feb 01, 2021 at 07:12:53AM +0000, Avri Altman wrote: > > > > > > > +#define WORK_PENDING 0 > > > > > > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */ > > > > > > Rather than fixing it with macro, how about using sysfs and make it > > > > > > configurable? > > > > > Yes. > > > > > I will add a patch making all the logic configurable. > > > > > As all those are hpb-related parameters, I think module parameters are > > > > more adequate. > > > > > > > > No, this is not the 1990's, please never add new module parameters to > > > > drivers. If not for the basic problem of they do not work on a > > > > per-device basis, but on a per-driver basis, which is what you almost > > > > never want. > > > OK. > > > > > > > > > > > But why would you want to change this value, why can't the driver "just > > > > work" and not need manual intervention? > > > It is. > > > But those are a knobs each vendor may want to tweak, > > > So it'll be optimized with its internal device's implementation. > > > > > > Tweaking the parameters, as well as the entire logic, is really an endless > > task. > > > Some logic works better for some scenarios, while falling behind on others. > > > > Shouldn't the hardware know how to handle this dynamically? If not, how > > is a user going to know? > There is one "brain". > It is either in the device - in device mode, Or in the host - in host mode control. > The "brain" decides which region is active, thus carrying the physical address along with the logical - > minimizing context switches in the device's RAM. > > There can be up to N active regions. > Activation and deactivation has its overhead. > So basically it is a constraint-optimization problem. So how do you solve it? And how would you expect a user to solve it if the kernel can not? You better document the heck out of these configuration options :) thanks, greg k-h