Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3048171rwb; Fri, 20 Jan 2023 10:28:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvNeP7zNYmzwlHjOwvwaMTwO1yIM6MgLW59sqaGIf1RD8fxKaTYBTQzdlSxxA1Ff1eEEknA X-Received: by 2002:a17:90b:3c0d:b0:226:e0da:fcc2 with SMTP id pb13-20020a17090b3c0d00b00226e0dafcc2mr15284171pjb.47.1674239313250; Fri, 20 Jan 2023 10:28:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674239313; cv=none; d=google.com; s=arc-20160816; b=zxG2/KEi3jNwWkMiswJNeoWo+yGa5kJjOooNltRDbeW98BrWMCB/cdgd3Iy9P5QPip q1zSbxmYAGbbLLcaKqHaq3P3BRZDYLspcA41LbksMTCPF+dP1NSinD7okaFqq9nmRIWD IOBaUzH+9/3QB7TaCNeRUfUIKD2Y0fyUxL4v5sTWpQu2p7k9r2TPAqlb+BBf0aqTuHo7 KOFdiP64xblW5dDgxnz5M9QFOfqp9AUrXr4Tx1osiChgvwuBip4u1UTnKPlpysT07GnB fXO2QdXTxqj7xmmmrwZ0FZ3Bqin68FNaYP6hXfW9sWRO+E14eYWctMmAk4DP1yueM+Mi ILaQ== 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:date:subject:cc:to:from :dkim-signature; bh=MdinPY6vQ8fVw027uUZU584MsmM5YD/+rGjhklLF+d8=; b=daze6Ou3cR9RrHke8iKAFGq+hbN/61PynI6PnhbS+Zk0gArT+T+0hyQKAOIs8H3h5Q 9dTx1V3LIRc9lcV+DOfQ+PlcmHBnnNEpZebrkhhY/mKVhcK4ujbl3sUXvv5QG7kBQOO6 Y85coFpx6rYRypjtWfGbMApUnMycqRr9BeS4NWNYQcB45EvjvKM+zfsaA3S4CMnejXtx X8vPL0T4CXKdxyudLYEYkkeQxpFGj+WiXrfCr0LR8CBRzsdY5lrNTtVcIvZfkVAN6guR 9vD/gmn7vTZnEaWf0/6Y3ShUUAL64DH9K/A1heJR7vlmqhB+H0ETJOs8vgpKIChItU7l C8yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="cFO/QjjT"; 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 bc22-20020a656d96000000b004d00fa50b0csi10196485pgb.53.2023.01.20.10.28.25; Fri, 20 Jan 2023 10:28:33 -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=@redhat.com header.s=mimecast20190719 header.b="cFO/QjjT"; 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 S231162AbjATR6n (ORCPT + 50 others); Fri, 20 Jan 2023 12:58:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjATR6a (ORCPT ); Fri, 20 Jan 2023 12:58:30 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66EEF59250 for ; Fri, 20 Jan 2023 09:56:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674237387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MdinPY6vQ8fVw027uUZU584MsmM5YD/+rGjhklLF+d8=; b=cFO/QjjTbCLg0xDh6iXEiLW4oUTkbM58OgkI2fVY9QDq9K1Zjcm+L5Ds+99sNPnQI9Wjvq 7DvKgvfHnnRE9Y7SA5UPvTmAxtzNPyelmxEQqo/O7I3HbUL0aDDuI7wQSj1fr+9WwxYHZE sGW+Bc6mu1NASZ/5NL8XLtM9hF2YPFE= 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-442-XWXguqUFNAG-6TTKujd0rA-1; Fri, 20 Jan 2023 12:56:20 -0500 X-MC-Unique: XWXguqUFNAG-6TTKujd0rA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D11A101A521; Fri, 20 Jan 2023 17:56:19 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.33.36.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id E593A492C3C; Fri, 20 Jan 2023 17:56:17 +0000 (UTC) From: David Howells To: Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org Subject: [PATCH v7 8/8] mm: Renumber FOLL_GET and FOLL_PIN down Date: Fri, 20 Jan 2023 17:55:56 +0000 Message-Id: <20230120175556.3556978-9-dhowells@redhat.com> In-Reply-To: <20230120175556.3556978-1-dhowells@redhat.com> References: <20230120175556.3556978-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Renumber FOLL_GET and FOLL_PIN down to bit 0 and 1 respectively so that they are coincidentally the same as BIO_PAGE_REFFED and BIO_PAGE_PINNED and also so that they can be stored in the bottom two bits of a page pointer (something I'm looking at for zerocopy socket fragments). Signed-off-by: David Howells cc: Al Viro cc: Christoph Hellwig cc: Matthew Wilcox cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- include/linux/mm.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index f1cf8f4eb946..33c9eacd9548 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3074,12 +3074,13 @@ static inline vm_fault_t vmf_error(int err) struct page *follow_page(struct vm_area_struct *vma, unsigned long address, unsigned int foll_flags); -#define FOLL_WRITE 0x01 /* check pte is writable */ -#define FOLL_TOUCH 0x02 /* mark page accessed */ -#define FOLL_GET 0x04 /* do get_page on page */ -#define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ -#define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ -#define FOLL_NOWAIT 0x20 /* if a disk transfer is needed, start the IO +#define FOLL_GET 0x01 /* do get_page on page (equivalent to BIO_FOLL_GET) */ +#define FOLL_PIN 0x02 /* pages must be released via unpin_user_page */ +#define FOLL_WRITE 0x04 /* check pte is writable */ +#define FOLL_TOUCH 0x08 /* mark page accessed */ +#define FOLL_DUMP 0x10 /* give error on hole if it would be zero */ +#define FOLL_FORCE 0x20 /* get_user_pages read/write w/o permission */ +#define FOLL_NOWAIT 0x40 /* if a disk transfer is needed, start the IO * and return without waiting upon it */ #define FOLL_NOFAULT 0x80 /* do not fault in pages */ #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ @@ -3088,7 +3089,6 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, #define FOLL_ANON 0x8000 /* don't do file mappings */ #define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */ #define FOLL_SPLIT_PMD 0x20000 /* split huge pmd before returning */ -#define FOLL_PIN 0x40000 /* pages must be released via unpin_user_page */ #define FOLL_FAST_ONLY 0x80000 /* gup_fast: prevent fall-back to slow gup */ #define FOLL_PCI_P2PDMA 0x100000 /* allow returning PCI P2PDMA pages */ #define FOLL_INTERRUPTIBLE 0x200000 /* allow interrupts from generic signals */