Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1819660rwd; Tue, 13 Jun 2023 14:57:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7h6NIXChKundA3vOpxWmFChPyr/FmKVFGIy+WtxXjm1aLOx7xaPefcUXekqversysmsNG9 X-Received: by 2002:a17:907:7b92:b0:973:93c3:16a1 with SMTP id ne18-20020a1709077b9200b0097393c316a1mr14123301ejc.19.1686693460000; Tue, 13 Jun 2023 14:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686693459; cv=none; d=google.com; s=arc-20160816; b=hdtAF6hG7UvSkzSR7fHJ24oyhvWhlppGsCskMg0aPhdq+hejBzLO2CVw0Ri1oHcFW4 cmCjRvFItO5ggx/yukwlsDtg5Qb8bQbXZ2qYgfxUTt5tSrBgH84gLK6X2n/2XAb/D3an QDr0gL6MxSjPGBzmUr+Dl8JrrsBj6vGWYAAsze/jqYKNImzaSQ94oR8O4LHnqWTiBNHf HGmfFcmpf0QJO+d0Cwc9/Iqkhg/CsekkqAUZuOaKcms5ZKhA0bZnknBnqBUu8bnZBls/ 9DxSUWuh9HbdEaF/cCjYigOLZBRqZ6LKzxEMPHqB2QA1BAuUutKF2Ao75O1SBNDAdOrk HgBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=ds/y7lH76obKk3se56kRnUXeuApDjVV7xaTlhnaSY1k=; b=SFXjpn4I8IVUZfmZ3WNAdQNb3NebzrGhlMSJMTvI6n1EBBIJsauSum30ikAMJs0V3a /9REOMpSXfLxDmInf9ji5LZTvIC+LHzMLTbAzQz1PuAylHVDJIsNkpHH7UZo1mpTMVM/ 6Cw0GalDe/JIRfa4fbQTNM8pwsKlBMYPqBMxY+CJAALOVJ2lrG8DGd+B1t++xFpDU7xc /k390D8PGTNbZlfgjKluWEyM9YI3X+AOxJ/BPRVsBCLJTJ4jhPXWy91o3VHNZeHjhkuD +qQppk9Fl7KjDmheLk7oroS50l/s4klrkasr32BFhW+SPo2cVF1UdS98AUzPrIy4vhbD epYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b4olZ5kh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a170906340c00b00978ae1e2e8asi7082283ejb.92.2023.06.13.14.57.13; Tue, 13 Jun 2023 14:57:39 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b4olZ5kh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232989AbjFMVht (ORCPT + 99 others); Tue, 13 Jun 2023 17:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbjFMVhj (ORCPT ); Tue, 13 Jun 2023 17:37:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92A652102 for ; Tue, 13 Jun 2023 14:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686692180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ds/y7lH76obKk3se56kRnUXeuApDjVV7xaTlhnaSY1k=; b=b4olZ5khCAoYI7d3CmYbLcpP2WsXu4TidVpvHYr5Ne5R6hhntSdShb+3scbRV7l+/QKPDw 4bmbZ8SWlRNuDzpFgqzASMUovdlkFHZpzA3Xriy9tZ3mfX0TEUU2S6ToVFc/KCjNm7qCFk sLzki9WKL9WH0tJ0Vx5xStghjpjGt6g= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-eu5Jh_yLPdaKczsKDCMpHA-1; Tue, 13 Jun 2023 17:36:15 -0400 X-MC-Unique: eu5Jh_yLPdaKczsKDCMpHA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4F90811E8D; Tue, 13 Jun 2023 21:36:14 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D5D140C6F5D; Tue, 13 Jun 2023 21:36:12 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <1156283.1686692027@warthog.procyon.org.uk> References: <1156283.1686692027@warthog.procyon.org.uk> <431929.1686588681@warthog.procyon.org.uk> To: David Hildenbrand Cc: dhowells@redhat.com, Jens Axboe , kernel test robot , Christoph Hellwig , Andrew Morton , Al Viro , Matthew Wilcox , Jan Kara , Jeff Layton , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , Lorenzo Stoakes , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block: Fix dio_bio_alloc() to set BIO_PAGE_PINNED MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1157973.1686692171.1@warthog.procyon.org.uk> Date: Tue, 13 Jun 2023 22:36:11 +0100 Message-ID: <1157974.1686692171@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 static inline void dio_cleanup(struct dio *dio, struct dio_submit *sdio) { - while (sdio->head < sdio->tail) - put_page(dio->pages[sdio->head++]); + if (dio->is_pinned) + unpin_user_pages(dio->pages + sdio->head, + sdio->tail - sdio->head); } /* Meh. It's obvious. Need to advance head. David