From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [Patch v2] Storvsc: Select channel based on available percentage of ring buffer to write Date: Fri, 20 Apr 2018 08:50:43 -0700 Message-ID: <20180420085043.3a678b89@xeon-e3> References: <20180419215424.3557-1-longli@linuxonhyperv.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180419215424.3557-1-longli@linuxonhyperv.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Long Li Cc: Stephen Hemminger , linux-scsi@vger.kernel.org, "Martin K . Petersen" , "James E . J . Bottomley" , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, Haiyang Zhang List-Id: linux-scsi@vger.kernel.org On Thu, 19 Apr 2018 14:54:24 -0700 Long Li wrote: > From: Long Li > > This is a best effort for estimating on how busy the ring buffer is for > that channel, based on available buffer to write in percentage. It is still > possible that at the time of actual ring buffer write, the space may not be > available due to other processes may be writing at the time. > > Selecting a channel based on how full it is can reduce the possibility that > a ring buffer write will fail, and avoid the situation a channel is over > busy. > > Now it's possible that storvsc can use a smaller ring buffer size > (e.g. 40k bytes) to take advantage of cache locality. > > Changes. > v2: Pre-allocate struct cpumask on the heap. > Struct cpumask is a big structure (1k bytes) when CONFIG_NR_CPUS=8192 (default > value when CONFIG_MAXSMP=y). Don't use kernel stack for it by pre-allocating > them using kmalloc when channels are first initialized. > > Signed-off-by: Long Li Reviewed-by: Stephen Hemminger