Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp304684iog; Tue, 28 Jun 2022 23:58:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tYx7Xnv78su6Ch53/Dknmdy4Naiz3rSwE1rA4W8sdauCphcuS9tqBjTHhjHn3wz7MA7vPU X-Received: by 2002:a17:906:6a14:b0:726:9f30:35f8 with SMTP id qw20-20020a1709066a1400b007269f3035f8mr1861868ejc.36.1656485920339; Tue, 28 Jun 2022 23:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656485920; cv=none; d=google.com; s=arc-20160816; b=OxcU7SnX9ep1oChifvVQiOJaAwdl8wjAH1CNNbrdyY6Jj3GAUs318BW8fwERqOLBAb vcjp0zcbSQEyYMNtSvwjQtsdmavOjl9yFQ7bK3ZOtCbYsc4C5NX1cR49tj5ASa8wWIy2 EYo/In9MLenNBBcam0rsdnmQ/K7tqGylapyKv+87F300D+tjBugpSVn//uG17nIr4OiE 6eEjUDps+xrZXayqSAsNRj643JT0Tl6YsOkbK7O9+I8XG1hPWSe+F8kkZYtOuRjsjDgn kDI0OpoyQW/XZw3wxTP33NhMGtql1BjdjEuNgaG7kOErtsUy+CGeTi5ggA/bhYc/fpnB P9eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JrjO8tBU/JzWiQQVO/ztz9PRUNAKEwkNcVzGxTEVVNE=; b=oVLeT5ulXPK1WCeSr6YiX5Nvnl+QieRiINIhRXw60BIBi1l5EFzLBGX8novz3qiHSN zWjd5PhjXUpwf4ELeUbGa+6yFYiW/Moe5iCHxFcXds0aV/61soY8QKdILsdpWcVksO3g CTn9njlUCMHAx/Am04163fkXGjZ41DFWqbdilzJe5GiYrtsnsrQLm1oJszgG+O/7zR4V S3OC/WdMcqz3DiPvdfwH2lJjFlmhRQAhMJvz/JQ6BiJ12TM/I19wqRj/zzvXPOgo43eo S/nSEqCOUNQmPqjaAADXFW7ew3cfLYtDDbIzCBvm6USdH2I8fkyCpW48PUFF0dbdpwjM 1yYQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c14-20020a170906d18e00b00711e3fede57si17174821ejz.190.2022.06.28.23.58.14; Tue, 28 Jun 2022 23:58:40 -0700 (PDT) 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; 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 S232333AbiF2Gqe (ORCPT + 99 others); Wed, 29 Jun 2022 02:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231629AbiF2Gqd (ORCPT ); Wed, 29 Jun 2022 02:46:33 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84042ED6C; Tue, 28 Jun 2022 23:46:32 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id DA93F67373; Wed, 29 Jun 2022 08:46:29 +0200 (CEST) Date: Wed, 29 Jun 2022 08:46:29 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Christoph Hellwig , Dan Williams , Jason Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell Subject: Re: [PATCH v7 16/21] block: add check when merging zone device pages Message-ID: <20220629064629.GC17576@lst.de> References: <20220615161233.17527-1-logang@deltatee.com> <20220615161233.17527-17-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615161233.17527-17-logang@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Wed, Jun 15, 2022 at 10:12:28AM -0600, Logan Gunthorpe wrote: > Consecutive zone device pages should not be merged into the same sgl > or bvec segment with other types of pages or if they belong to different > pgmaps. Otherwise getting the pgmap of a given segment is not possible > without scanning the entire segment. This helper returns true either if > both pages are not zone device pages or both pages are zone device > pages with the same pgmap. > > Add a helper to determine if zone device pages are mergeable and use > this helper in page_is_mergeable(). Any reason not to simply set REQ_NOMERGE for these requests? We can't merge for passthrough requests anyway, and genrally don't merge for direct I/O either, so adding all this overhead seems a bit pointless.