Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5672583rwl; Sun, 8 Jan 2023 20:25:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXvKn+dWm2ypJ9ho0j+N9so+SEnKu9Jni96mssucv/e34b/6NAoI8kS222ZxdnWfyVvFogXf X-Received: by 2002:a17:906:703:b0:84d:1366:c74d with SMTP id y3-20020a170906070300b0084d1366c74dmr11353414ejb.63.1673238302787; Sun, 08 Jan 2023 20:25:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673238302; cv=none; d=google.com; s=arc-20160816; b=A0DptJpRwJ7jlWCgnjXLcRl82IQtjKYvbXCha7a2wkmMxR7VI1hozbycIOF8nNCSLk NqdQrF1Hg4+vjjJRDW5OCwlUs18zOIY9ztRTLCXUn7lEPSF1Cm6gaxtomPmAHheP/GPV GtqhtArCLj7CcKdkf1D7vPXZP9O31ArI69FkEFUw6QG6M6gcQfr33V7MLeQjP2H1+AVX et2DFV5pTEhn8MlPr3TKJitolPOtTLBZ1028XVPn2DYuprhEtHPlDoHrbs4loCwwskoR 0m6sMsQDbCLqvBYPSwA8sRNoqgekNga44FRljYGOiWcRXB7tD4wyQDnvw9Y6EjoJjbJA f1oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=TpgfqkNhPqEV+WEtXe6exPW4ehifsekBo6yCYNhed1Q=; b=glA7YVHx51ciodf2jOpCRaMagHQcA9dunT63ZcMlg8+nBcf7u4CLFLsc6lhDE4S6kS aGz6Je1y17/o0b8ZYytsaDib7xSsXX1GSvyj68ppW+f+FSDWti54UyPgfAFnSRVsDPmD MkBsogyPLfYYOJDfQuYov/haVf2IK6QDpqcI+doNA1mGNvQ8UjNgvUTdPnoe+tQyo6FH PcosaP0w6tifgxgdeR7tted1gOfd6TCkhTDeyv/pKr0PPqbSIwqvMkCD4TRwR1Sl6o2l yvdFSF8IQnhxE8xdP7gR1ic7biHpYBlyQHRBLjkwhYqUQWH+RbXYx0nVvjSHAkWeN8Sc mxSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="2+Y/8pxM"; 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 gb2-20020a170907960200b0077f3a9c58e2si8678390ejc.6.2023.01.08.20.24.50; Sun, 08 Jan 2023 20:25:02 -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=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="2+Y/8pxM"; 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 S236181AbjAID4D (ORCPT + 52 others); Sun, 8 Jan 2023 22:56:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236645AbjAIDzT (ORCPT ); Sun, 8 Jan 2023 22:55:19 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79D7F11C26 for ; Sun, 8 Jan 2023 19:54:14 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id z9-20020a17090a468900b00226b6e7aeeaso8079629pjf.1 for ; Sun, 08 Jan 2023 19:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TpgfqkNhPqEV+WEtXe6exPW4ehifsekBo6yCYNhed1Q=; b=2+Y/8pxMywf4CuY6rlA26Z8wlez6yJKwtYUVrUxQUWc4Jfip0sOQU4a6bJ379AYtE5 +Kb5CYmTtVwHP/5MDDCmurkG9wu8slKevWOvWTfcvRd7Ixny78Tuo+6N7diZ8GuLy/e9 onreXGi5DCuTn/6kdNwIHNEFbeQXZv1P+zT3hcEZvpYkMOxtqAxe1F2FumunVb2Z67Rr dDiR17uCH+iunJiXUfKY6JU59DVx8qZZV1s7jU1znvDXo0u1sFsleVJsV3CK3u5uLf/g sIJx+pqtlO3sFqNcA7UGUzhv29M/sLZIz6pFaC5XIsBU4bBfVDI1McQyVo7Bp6jiv+Gd ACEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TpgfqkNhPqEV+WEtXe6exPW4ehifsekBo6yCYNhed1Q=; b=sZnhxB3F62K9ttA+D4z/y0seWfFi1NPyfrN5WmRkwCwhY6l/kgnxIIJxx4C0BHE8yB bWn16Ugw2/KOkqwD5PrKMBI/S0fT77x25qGv8f6jxQ6jvmc0MqFJOSg1oPmcNY4qnBjC DctefxqxyXa8KeyZ67gohLnn/dDbpbxlqNv9B9/hf1CyipD1qgCmVIWfW+K01fR01Pa7 S6CUOZNU+NFuvLkyX+e2ytGqGApDSGAOAH8QvcJvCmYby7C/cGfeM+oHN9n4rnzC67id C/7NisIOPxRd/LucudZcoRZe5U+/OE6qgLv43G1pMmSiZwSM0tpndQ8ypS/fZsxF/vUQ f27Q== X-Gm-Message-State: AFqh2krtimA7Zb+8x8lHqOQFTBhqROie4B50fNCGxVF8NjMyLoAgFczs laQ1aZlmptos73g1vm+TDNzGRlXPrH3ST72T X-Received: by 2002:a17:902:cf91:b0:193:2d46:abe0 with SMTP id l17-20020a170902cf9100b001932d46abe0mr733811ply.6.1673236453985; Sun, 08 Jan 2023 19:54:13 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id y2-20020a17090264c200b00192a3e13b39sm3546210pli.264.2023.01.08.19.54.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Jan 2023 19:54:13 -0800 (PST) Message-ID: Date: Sun, 8 Jan 2023 20:54:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v4 7/7] iov_iter, block: Make bio structs pin pages rather than ref'ing if appropriate Content-Language: en-US To: David Howells , Al Viro Cc: Christoph Hellwig , Matthew Wilcox , Logan Gunthorpe , Christoph Hellwig , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <167305160937.1521586.133299343565358971.stgit@warthog.procyon.org.uk> <167305166150.1521586.10220949115402059720.stgit@warthog.procyon.org.uk> From: Jens Axboe In-Reply-To: <167305166150.1521586.10220949115402059720.stgit@warthog.procyon.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 1/6/23 5:34 PM, David Howells wrote: > Convert the block layer's bio code to use iov_iter_extract_pages() instead > of iov_iter_get_pages(). This will pin pages or leave them unaltered > rather than getting a ref on them as appropriate to the source iterator. > > A field, bi_cleanup_mode, is added to the bio struct that gets set by > iov_iter_extract_pages() with FOLL_* flags indicating what cleanup is > necessary. FOLL_GET -> put_page(), FOLL_PIN -> unpin_user_page(). Other > flags could also be used in future. > > Newly allocated bio structs have bi_cleanup_mode set to FOLL_GET to > indicate that attached pages are ref'd by default. Cloning sets it to 0. > __bio_iov_iter_get_pages() overrides it to what iov_iter_extract_pages() > indicates. What's the motivation for this change? It's growing struct bio, which we can have a lot of in the system. I read the cover letter too and I can tell what the change does, but there's no justification really for the change. So unless there's a good reason to do this, then that's a NAK in terms of just the addition to struct bio alone. -- Jens Axboe