Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8629896rwl; Tue, 10 Jan 2023 16:46:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXsX3Bop1Y9l5uKb/q2oUBwz4hQA7NOg7JdqOvqUCmQGvGcFoz0ccrarGFPhiGfCLX2zsrx4 X-Received: by 2002:a17:902:c814:b0:193:a5b:ccf6 with SMTP id u20-20020a170902c81400b001930a5bccf6mr1063307plx.0.1673398003641; Tue, 10 Jan 2023 16:46:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673398003; cv=none; d=google.com; s=arc-20160816; b=s4MTlxJvUpH3mHWoz2yH67oLqZfsZ23+yPYfkiF/pAEQvPYRW6oOVrYLIhCJYMSr7h Djg+jbLen08peFZCbgPlZaX8P5DH2lSXt3Css4x+0cDCHk0em9sS9qHDtGoEesp892bV zkQ4DdR/uy4fOuCqHeaQmcAzmREcp2/rbQZg0P0cONy110jrmYe2/WmLsn5HO/tVisTK Wm7u7KaxabI6pZKKfEND/vOcWOELrid+KOAPcxWIn+bfHtN50n5awPqj3VmL8EmloDP3 wm/kwteb+wGq/rA+l38xrDeMBuue8PjESBDlw1OwPA35WqwCofJifKdoTQCeBJMmWj+L XsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=5nlQehVB1yko2kaEHfgNOQbsaE0dgngRN4LgIRCgS7k=; b=bRsYuuqgPHcru1lTcxUQR8Ukjd19b9cXK/Cvaq7hJ0LphMR+VBQDjxbGR4iAipAjRo SzwklZUY/Z0BWnMfeiRuym68eL6txo9Jb+zSS7ZAoW3aAxm7GQnYh1BV2JiKi6KfJhrV R8rNDAxzn4NPAjrpEYTFRjcBM3sorWpMrGPwlG7CqqJa79YW4jWRUd4kGZzIbo0qr7FX PcrqF9QgbaHNO38usgHx3Cd6HiFOT5mPr0FiDSZtLNXl7SIfjkjTnYlbTOusofDJjGg7 VfoakZpqSWOi/xi7AUBfe9dO7xEQAKqbBrwF+379xLgXVMzarp2ZszGHtfEV39tZUhch 6PXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=eImWOhdQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a170902e75200b001893b7f5ed7si13932846plf.205.2023.01.10.16.46.36; Tue, 10 Jan 2023 16:46:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=eImWOhdQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234969AbjAKAD4 (ORCPT + 53 others); Tue, 10 Jan 2023 19:03:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231939AbjAKADv (ORCPT ); Tue, 10 Jan 2023 19:03:51 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D58701E3CC; Tue, 10 Jan 2023 16:03:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 923C5B80F92; Wed, 11 Jan 2023 00:03:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D660CC433D2; Wed, 11 Jan 2023 00:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1673395428; bh=+OnFk+nK2FJmejEzbeXpqhqfabYhGoHiq3T5ktvxINM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eImWOhdQkI/PtTOlc6FwsU5bJ5gZfkgokwiatUTAT5sSMZyzcc/5OG6Cj2FpYy0Ji uSo4fCT14oSdvWIMNNCrozckkzLwfFno3ogSovtwTkqsXEKV8vnqynwOIP0vQDdmZn N2/H0rokjq7tkxNGbfCUEYLaX6K/QD5d2SwopIR4= Date: Tue, 10 Jan 2023 16:03:47 -0800 From: Andrew Morton To: Jens Axboe Cc: Yishai Hadas , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, jgg@nvidia.com, logang@deltatee.com, hch@lst.de, alex.williamson@redhat.com, leonro@nvidia.com, maorg@nvidia.com Subject: Re: [PATCH] lib/scatterlist: Fix to calculate the last_pg properly Message-Id: <20230110160347.c1d771e4ea21e4b95bfa8477@linux-foundation.org> In-Reply-To: References: <20230109144701.83021-1-yishaih@nvidia.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Jan 2023 20:18:39 -0700 Jens Axboe wrote: > On 1/9/23 7:47 AM, Yishai Hadas wrote: > > The last_pg is wrong, it is actually the first page of the last > > scatterlist element. To get the last page of the last scatterlist > > element we have to add prv->length. So it is checking mergability > > against the wrong page, Further, a SG element is not guaranteed to end > > on a page boundary, so we have to check the sub page location also for > > merge eligibility. > > > > Fix the above by checking physical contiguity, compute the actual last > > page and then call pages_are_mergable(). > > Reviewed-by: Jens Axboe > > Andrew, can you pick this one up? This patch is against Yishai's CommitDate: Thu Jan 5 16:01:05 2023 -0400 lib/scatterlist: Fix to merge contiguous pages into the last SG properly which is in -next, apparently via a tree of Jason's. So I'll assume that Jason will handleit?