Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp240423ima; Fri, 15 Mar 2019 01:35:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCq+KXxULVgn9SSM2B27GQBu9MHmSh1Ffr7hFArVyZDasX9brAWFfknn5/eqFKGyIbs1MO X-Received: by 2002:a17:902:b216:: with SMTP id t22mr2911048plr.39.1552638925205; Fri, 15 Mar 2019 01:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552638925; cv=none; d=google.com; s=arc-20160816; b=X0xlaOUJDn80yJEKoJVQzaHJjMBM9/bJn5Y9tcA/7z1Xs4riQhqXLmKxMeqvcO+woq eNyi22mzneniUif+3I/r4RwsjsKCgdU/dVCv1h8NlCCBkD1HB18jEr0Vp7NNDO8JNadV UE+OwEsB042jEZdm16EVa2v0f0mGlJq7rLqM5dQVUbCx1OQxSuSNMAYLMkoSjlqYIc13 m3bqhcOClLGqdIvuDb6DEYB8hrICJLH68mZM3FfO+v48EDbtsvIGRpZv2ijnnRlW9IV2 PXXx0u+lFeXLpDRw6U++vLfAScWt3Ad9TJ/yiRS0FbrUTLQC3ePQyvkYzX4gqkvzpIQ9 4LSQ== 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=s5upj3v+TSeq1leK9fAsZyA35bnuuGD34MaHoF8Wovc=; b=FbmQ40d7yAiUbsRzpxj1rbfehZqnsP8oMguYlPkcb2ykQbpIeCd21+r7BgftPExM2q YtYc+sGrGy5XJmu2EKfNM81DEyebtxEVsKoZqA5lDyJH3clYpCbdlDlemK0PYX1Y4ZSe qFZRbC9vhJQzL0HaZKPcInS3N4c9V0OUrrkAFAn4vLkjriNBrgZk8CgtpQ73HUuRJca/ W1Pu1rDB9IHrUQMjw9qpcBZoaQfR6+y19xxlHLiuBK4nQQFDRMgulzsu2eqSj2WP4m6I 4FoRG4v+iOOM+NiNlRiawowGDHQgsd7MyT8PftLlczOZaci0MJDcvSGo+IBSlg3xWE4k xCog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=oELe57sN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si1265973pgq.341.2019.03.15.01.35.08; Fri, 15 Mar 2019 01:35:25 -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=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=oELe57sN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728059AbfCOIe0 (ORCPT + 99 others); Fri, 15 Mar 2019 04:34:26 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:41804 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbfCOIe0 (ORCPT ); Fri, 15 Mar 2019 04:34:26 -0400 Received: by mail-vs1-f67.google.com with SMTP id z25so3597549vsk.8 for ; Fri, 15 Mar 2019 01:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owltronix-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=s5upj3v+TSeq1leK9fAsZyA35bnuuGD34MaHoF8Wovc=; b=oELe57sNsZVSlcdttIyaeC7KAlvCBASH9QF93WSwUDxIg+1CrtRF1RpKzM9b+HjwGT BIHOmR8TfKZopjrL+FtSWIGBQb3XouaNWBT2N3EGmPeaxj/zfOJVfYx9fk/8DfrxTVyp ZlAGpvkBWHympzmyvQlgaiilHO8DkCii1ks7f02JVe6ZM1DlbReaIxOqLiSSpA2mubG2 GyoPtbv/zexGKFstBr83F7stkYri7dSs4veM4B0p+uyauq9kRtCWoBHTDwFi5AfnD2fa b6qRVAVvKStlE+21JuETHds0/zbf3bN7m9hGE3nL2ROEVATxSZDUEKCwzOpGJsfNnCrD hNPg== 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=s5upj3v+TSeq1leK9fAsZyA35bnuuGD34MaHoF8Wovc=; b=jOHzZQ727dyyJ9dNYrQmuTFrucCzmiPCSXoRNJBtSr3CMc/rZZ5kFbWCF/tVzjHmFk N4TSxefOpdwi8LsADkIBoHM9KpdqCeY7tceUapWVdvfqAQLDD4HD+cdbXYS7rU8kPxte WIp6COti5m1pCoW3NdjYaB7NMJr3NAjwSBPkhak5l+72p5S5OjrptDQzSPUapcr29aD+ BGYKJlhEgL1kErtM5T7pLQu7yKKPrs4v1efq+eGqEmBGY4QtJzr1DAXmkwn1O2AzlegB rb3oG/pCeHQmUWIR9ovrgKVxJ9V2iH6qPQ6jqu0T4mlE4de9km1kAHo7Oqr/8BIrvbp7 PVoA== X-Gm-Message-State: APjAAAUhKN/vtFAb6QJV01nYdb1vudDlAZGRVqcTjHsqnFwLmvCbXwju z+IsA4Do335J+ClRgomha7TS29EM5AUpJrZwgmVsYw== X-Received: by 2002:a67:ba05:: with SMTP id l5mr1305615vsn.153.1552638865111; Fri, 15 Mar 2019 01:34:25 -0700 (PDT) MIME-Version: 1.0 References: <20190314111637.20236-1-hans@owltronix.com> <103c19f4-02a2-f54c-13f8-30bc5447426e@intel.com> In-Reply-To: From: Hans Holmberg Date: Fri, 15 Mar 2019 09:34:14 +0100 Message-ID: Subject: Re: [PATCH RFC] lightnvm: pblk: fix crash in pblk_end_partial_read due to multipage bvecs To: Heiner Litz Cc: =?UTF-8?Q?Javier_Gonz=C3=A1lez?= , =?UTF-8?Q?Matias_Bj=C3=B8rling?= , Klaus Birkelund Jensen , "Konopko, Igor J" , 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 5:15 PM Heiner Litz wrote: > > On Thu, Mar 14, 2019 at 7:16 AM Javier Gonz=C3=A1lez = wrote: > > > > > On 14 Mar 2019, at 06.49, Igor Konopko wro= te: > > > > > > While reading this patch, idea came to my mind - maybe it would be si= mply better to get rid of partial read handling from pblk in current form a= t all and use bio_split() & bio_chain() combination instead? > > > > > > This would definitely reduce a number of this 'kind of complicated' c= ode inside pblk and let block layer help us with that. Even that the perfor= mance of such a requests could be a little worse (few smaller IOs instead o= f single vector IO), I believe that partial read is more a corner case, the= n 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 patc= h 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. > > I agree as well, this path deserves some loving care and cleanup. Let's just try to avoid read tail latency degradation. Simplifying the code is a great first step, then we can optimize if needed = be. Thanks for the feedback y'all! > > 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