Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp200867pja; Fri, 22 Nov 2019 05:23:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxXdVbqtFTMr18NicSp5obYwVMui90Ce1ZfwuYbt+4odQ2AyuAZManRScJV9f0sFsTvfjby X-Received: by 2002:a50:c3c5:: with SMTP id i5mr1044087edf.137.1574429012247; Fri, 22 Nov 2019 05:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574429012; cv=none; d=google.com; s=arc-20160816; b=j/FirAL/vCoroCegDNHh0WOnD+blIASQSRrp+gjsz1+W9dshZnuj7nFoEt0myer6yq /vADK2aSq4uHwIyKVbtiMfie3pg3uJ1lZfshhhvYAYDKwAxy3iGUJ5hVfTNL1kPKAtQo dzVnZ9DTa/JXtPHkDwXdH79uAdPQ3ZYA4Btx+i/QbL+ttbu/LF0SOFLitW/ViAtIZPfp s/IRIK0PLi0nb3nfSGF7TKKWy5UWBga4uiaSSIFtoXJyUIBzhUD+Nx1F50QLTP8LAdYu VzaTLkOJ9jTilTmwonA0febzGwT9zZA1bhYc4EHuiHHUsdWvwg5G+Uo6O7/r53S0uL/O QrCQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=Ky4ZxywYAc+Y33e81VVZxLUui9CmXsPpxMd7CkRfNgs=; b=jP6EF/tAhVZLLqpHAKaBCT+9pS2XjeFNuFfJve1ni9/RSep4MNu1Jf+KNOqancHIoc U/EL9vaMf4TtVFlMrxTXsilLBjVOfnunZWkIDcmpFCoky8dqNo8dnJg4yrJ9w4CiSUcs Ozm9KL/IpCNaCOt97cKksCM4FGYOThxhoTBUDLYvxPRZbEbQWfMN4BGYxtMPc7GmwbZT By4rc1XA5u+9FWYkPp1Xe7GBORjKTk2C4y87CJoFxuADpM899ZtErYPJ4hXL07OBr0F0 DNACJHe8d9pX8uOPO5iaFVpC9kfMQ2E8xe1kfY6Po/WSTRnjYhtAH6Ojl2eV3AkuJt4n 8Vwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nA5YGCJv; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10si6035028edj.316.2019.11.22.05.23.08; Fri, 22 Nov 2019 05:23:32 -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=@linaro.org header.s=google header.b=nA5YGCJv; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727551AbfKVNT6 (ORCPT + 99 others); Fri, 22 Nov 2019 08:19:58 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:47034 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbfKVNT6 (ORCPT ); Fri, 22 Nov 2019 08:19:58 -0500 Received: by mail-lj1-f194.google.com with SMTP id e9so7292294ljp.13 for ; Fri, 22 Nov 2019 05:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ky4ZxywYAc+Y33e81VVZxLUui9CmXsPpxMd7CkRfNgs=; b=nA5YGCJv7mfGExcfpgFDbA51hzmZP8EaXOT8OIj85jOGLkm0sKOfjCpHKhWfCRX69w Utvi1zv9EQCtFN2AQG8xmomFl81pCO8P8g8CU1Pv4On5nxehd9L6F431xv6DCnjFhZc1 zQd+gkPVR1pBH8hk1+YSPQeTZ/gqWTmPuq5GfDTABnrjLYfrG0ftjeZELZm2MMlG9A0y QBdtF3gt4BUc7app399ydHOGAV/cz5f+zb25BiH4OYagOAeVkSnqXfvKYikMQ49lHfAP TWHj/xZDFI9LBF265eoybrPJt9nBL2orV+H/yvBzr7UE8xxYxWQVylGR8Ho2p0OKLUR4 vXXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ky4ZxywYAc+Y33e81VVZxLUui9CmXsPpxMd7CkRfNgs=; b=EOCL0wn2aPitJsjj5/RJ535DcALriKkSfewcctMP9+mKqBvkPkrG3uebeg48GHXZLv BB2ajFp4taRz9VSF0gd/9nLVeGHJaH+XkuyKGDKTE8HY/7/kZ7xoFeP4HB9/lSC00Qum l3S5aFjsWTsfDvxO5Orf+x1asdKiyB+b6lsPdIsMXMR2Ry3mOiB6aH6QXkldE2prbQAE 6BgC0Z6hEl1Mik/PwPJw2TyBFdilw5178wZD+umXMuboa11xveh3aFmYImbvUVk4CPYo PACN3Xsi7hXK+88AhqWaArBlC3WSgmCuRe4mrwCgJJsDwbmU2zXgsren81gnBnxO4ZB5 G9pQ== X-Gm-Message-State: APjAAAVV/SQ1t5QYKitnn0XyK3DskdK7a/wgLnKI9Cx3PR7TZts/AfKu E2x59ADm614Z1y7IM9ltTsRVQr8QVoq0YIOGJtNspg== X-Received: by 2002:a2e:161b:: with SMTP id w27mr12308656ljd.183.1574428796307; Fri, 22 Nov 2019 05:19:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Walleij Date: Fri, 22 Nov 2019 14:19:44 +0100 Message-ID: Subject: Re: [PATCH v6 0/4] Add MMC software queue support To: Arnd Bergmann Cc: "(Exiting) Baolin Wang" , Baolin Wang , Adrian Hunter , Ulf Hansson , Asutosh Das , Orson Zhai , Lyra Zhang , Vincent Guittot , linux-mmc , "linux-kernel@vger.kernel.org" , Hannes Reinecke , linux-block , Paolo Valente 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 Fri, Nov 22, 2019 at 10:50 AM Arnd Bergmann wrote: > I suppose to make the submission non-blocking, all operations that > currently block in the submission path may have to be changed first. > > For the case of a partition switch (same for retune), I suppose > something like this can be done: > > - in queue_rq() check whether a partition switch is needed. If not, > submit the current rq > - if a partition switch is needed, submit the partition switch cmd > instead, and return busy status > - when the completion arrives for the partition switch, call back into > blk_mq to have it call queue_rq again. > > Or possibly even (this might not be possible without signifcant > restructuring): > > - when preparing a request that would require a partition switch, > insert another meta-request to switch the partition ahead of it. > > I do realize that this is a significant departure from how it was done > in the past, but it seems cleaner that way to me. This partition business really need a proper overhaul. I outlined the work elsewhere but the problem is that the eMMC "partitions" such as boot partitions and the usecase-defined "general" partition (notice SD cards do not have this problem) are badly integrated with the Linux partition manager. Instead of mapping these partitions 1:1 to the Linux partitions they are separate block devices with their own block queue while still having a name that suggest they are just a partition of the device. Which they are. The only thing peculiar with them is that the firmware in the card are aware of them, I think the partitions that are not primary may trade update correctness for speed, such that e.g. boot partitions may have extra redundant pages in the device so that they never become corrupted. But card vendors would have to comment. This has peculiar side effects yielding weird user experiences such that dd if=/dev/mmcblk0 of=my-mmc-backup.img will actually NOT make a backup of the whole device, only the primary partition. This should be fixed. My preferred solution would be to just catenate the logical blocks for these partitions beyond those of the primary partition, stash these offsets away somewhere and when they are accessed, insert special partition switch commands into the block scheduler just like you said. Right now the MMC core is trying to coordinate the uses of different partitions by arbitrating different requests from typically 4 different block devices instead which isn't very good to say the least. Also each block device eats memory and it should really just be one block device. Yours, Linus Walleij