Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3971884imc; Thu, 14 Mar 2019 09:17:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwG97cjMRlpsdVsge8/c8Tk+0xNEn6BdUMMCNyILrWXSF3K0DXyGJ/u2jwlx9jgX2n2DOPK X-Received: by 2002:a62:2e07:: with SMTP id u7mr6535119pfu.176.1552580257058; Thu, 14 Mar 2019 09:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552580257; cv=none; d=google.com; s=arc-20160816; b=JQLPcquh1p23cQ9/8J4R9K5ZDSESv30tDeVtFXOpncoUuOt9L0Go+c3VimT5LXXNU1 8Y9kx5qL5tgGYGMHSMK+vE22EPGfnYEaxUDpn0k8B/nIWd81J0clIKG/avU7d20bAhvP 0PWUigUqQCgeMr71rsotHKukD7vEvcdvBTyc5cZ0fB/MCftY9LbH/DlWbrD1rlhxKXSa DFp07Qt3RGRjxX+H3rwx3sLUZYLtzz3c1aUut3bogm9MUGqu6s3P8qZdHTx+3ywVRJYV KOw560ClHsFI5Ud7bCGWxsVMLJjmth6cpF9f80Gn0dEbsYR3CQUGhQxqfpwtILwgYDKZ PBPQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1ISUeNh72ONMqMRqy4Bb2sjGisIJL4lyuhKFUZ5ugZI=; b=IEiRyIP9WV+xJASysweior1Rp920Xb0tA4L/zGd68B/3BppmOM+IdblQWji5a7/hr+ PZ9Xfbb/1z4ejTjMyCNLT/pxrB9HeYxRZ0FRqLKMCFtiPfBvKae1slOh2Z69JbRsYXnQ MSCaxBI7+mzN/OUorn/WOst12hm5I645mHkoTF1BhbeHgDdLOHdlI8Zr0E3qgsX7XC12 A7ChLzIz8NuWIuCtjd5+FxB3nPVy1PcSVFYJub+qyPla6jODJj8pDRvSMpStKsw+61Cr QzjxYZCMqvJUXWqXQrPSalYGoUZsFazt+WonE09LIGyBAYUBbFB+Atd5btVN8Aj5bbbW mz3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ucsc.edu header.s=ucsc-google-2018 header.b=gEZWdUla; 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=QUARANTINE sp=NONE dis=NONE) header.from=ucsc.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4si12308146pgs.408.2019.03.14.09.17.21; Thu, 14 Mar 2019 09:17:37 -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=@ucsc.edu header.s=ucsc-google-2018 header.b=gEZWdUla; 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=QUARANTINE sp=NONE dis=NONE) header.from=ucsc.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbfCNQP3 (ORCPT + 99 others); Thu, 14 Mar 2019 12:15:29 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51053 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbfCNQP3 (ORCPT ); Thu, 14 Mar 2019 12:15:29 -0400 Received: by mail-wm1-f68.google.com with SMTP id x7so3659204wmj.0 for ; Thu, 14 Mar 2019 09:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsc.edu; s=ucsc-google-2018; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1ISUeNh72ONMqMRqy4Bb2sjGisIJL4lyuhKFUZ5ugZI=; b=gEZWdUlaRhIQHvvre3jWTj7jLamG1e2WK+qDYKpeB80Nw782C9NFv140uxGytbtH1g rljzSNPycaZbcc3NoQ58YrJzehccrSzBXhl9msC/VDItxI/bpRO06F3jnP9r1Gb+6uCJ BuVnXqks5ld9PGvPVBA3+XpXt1WQ9aCWJE06V54ShSu2VWvPZPKmZ2VkBmF5IvhZ/Omf coUdx09AMJDVNNoSnsVYaabY76Ut94Vsk2N/JBC/TP90iKuP4aqyJGE2r3Ptc1Z3qAxv +RMBBkVZ9LD9Y99jR6y1vdXnvuOuN/UQbmi2Y9ihKPDgLoJ9T0ngh7jKqq8Tf2TQSQwf rt0g== 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:content-transfer-encoding; bh=1ISUeNh72ONMqMRqy4Bb2sjGisIJL4lyuhKFUZ5ugZI=; b=jpjSAe6bvpqWVFRqlXd+khIt6e/2XudpkwF26kJkjMNHJuLQnH3tOxB9DlQQRYTw/8 KcZkcPoHC87fPT0CBR482hrDBsKjZbetbaNr3glbrUMQC1SStBj+CSy8YBmfH/0EomXX UobtTiqTGK7967YB9lnOKBiZDT++SBNAD4F1RM3fEi7yzFcOGksKFuSiCFJ66DxJwJp4 zpbhARSE2SEydNuazCO/4dkGHgcdD3RD3unsx3lUwSqfR6fq6Em18tBTkFREM/VcglhJ a0DLHx+GxMvhig8kF5wJ0zbE7B19j2fE19BhZlV2KUanNs6uo2gU2ChwmgJ6wCxVT1Gv bqaQ== X-Gm-Message-State: APjAAAWM8JxOnyIweBXOkZL7u8IiCy4xeGeoorzmny6AGrBOQUccuvLj zLtLhluXNWYpn8edP2zuKC7uuEjs1IOxaHJ0+LG5dQ== X-Received: by 2002:a1c:cc0c:: with SMTP id h12mr3387280wmb.140.1552580126550; Thu, 14 Mar 2019 09:15:26 -0700 (PDT) MIME-Version: 1.0 References: <20190314111637.20236-1-hans@owltronix.com> <103c19f4-02a2-f54c-13f8-30bc5447426e@intel.com> In-Reply-To: From: Heiner Litz Date: Thu, 14 Mar 2019 09:14:58 -0700 Message-ID: Subject: Re: [PATCH RFC] lightnvm: pblk: fix crash in pblk_end_partial_read due to multipage bvecs To: =?UTF-8?Q?Javier_Gonz=C3=A1lez?= Cc: "Konopko, Igor J" , Hans Holmberg , =?UTF-8?Q?Matias_Bj=C3=B8rling?= , Klaus Birkelund Jensen , linux-block@vger.kernel.org, Linux Kernel Mailing List , Hans Holmberg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 14, 2019 at 7:16 AM Javier Gonz=C3=A1lez w= rote: > > > On 14 Mar 2019, at 06.49, Igor Konopko wrote= : > > > > While reading this patch, idea came to my mind - maybe it would be simp= ly better to get rid of partial read handling from pblk in current form at = all and use bio_split() & bio_chain() combination instead? > > > > This would definitely reduce a number of this 'kind of complicated' cod= e inside pblk and let block layer help us with that. Even that the performa= nce of such a requests could be a little worse (few smaller IOs instead of = single vector IO), I believe that partial read is more a corner case, then = a typical use case, so maybe this would be a path to go. > > > > Let me know what you think about such an approach - I can make a patch = with that if you want. I like this idea as it will clean up a lot of code and get rid of the read_bitmap. Note that a single request can be turned into up to 32 requests if cached and non-cached sectors alternate, each one probably requiring an l2p lookup. I still think it's worth doing though. When you split, note that you have to release all line_refs which were acquired during l2p lookup. > > I agree with Igor. > > As I mentioned offline, we should fix this in a way that survives > further changes in struct bio; either making pblk handling visible to > the outside or rethinking the whole thing. > > Igor: If you can send a patch you mention, it would be great. I have > been trying the helper approach for some time, but it is too specific, > as fixing holes in the bvec breaks the bio advance-only semantics. Your > approach seems much better. > > Thanks, > Javier