Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4623712rdb; Tue, 12 Dec 2023 05:07:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFv5PNm3arvFFRRBJx7kW7CunrQzYMYed1lt6eGGkoRu7IFctxRkv8oQeTpWE8CM+dxlun4 X-Received: by 2002:a05:6e02:1c8b:b0:35d:a8a7:ba08 with SMTP id w11-20020a056e021c8b00b0035da8a7ba08mr9491548ill.86.1702386472339; Tue, 12 Dec 2023 05:07:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702386472; cv=none; d=google.com; s=arc-20160816; b=wHJdjrDyuv3W9Adu5cvuKxuY9xN7ijcxqIpWQkT50qa4edNCUD1YtXbjHBw83++F1g vqSKsvOr5x9kLawm5LdUwrKX8AkQjlt27nWzZdhuRKwuts4BSlsQay1Xg5WlYgQIB0MZ 6ZC02K10XTgE3e2l+AABiUr+YZvYT7dHAEhnVmGXK6Abq98wUKQibbbA2GFK9cXebgz4 XZEt3PO0fP4HJ1rsTILfvK1cyckhzMSTTrhY4HLqbjAcCnEajsCtPuMmqbbcbn+hlDF1 ZBPDgthD6fujiAojkJdy6Cm3aCRD+jzTttR61DE6XnjSeZMpfmbWz+v9Obwfh9Rx0WYa 5GPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Xbzg90/bq4JsbK+dNE7Eb/swVSGtySgf43OD8igrkzw=; fh=ZsuO+jHzbIr0tnFXvm8uEsJZRi3Inl49Igo1a0Yh/a0=; b=wiU2Sr8j47yeOXKwMFnGXes+T+mvoqda7xKrUWLGOH4Z/BJZwZqL4Yve2MZiUjrP5b cCA8R5ANoHm9jezDj7T8Ov0v9ExfsWflSb9C/11KRC6MMfkIR+KLG3sbAwYNXSf1+OJO 3RcrWdIUwjqlNSyHYHaV13MPUuFzm/D5pj8hN+5bFofvDxTWJbOKKi/bluhxvTo+duPl KLo4sNL6YOXQxUEOgFQyrnzC6ZSHLDU3cxX9NY0LyUbnLbcKjeWP5ZpB4U8y074RGWM/ BaBTqkbPlYT7Cfe8mV3hl14OmZi2gp5ig5MxMftLz3rfI0AWf/lZDdwilbbNL+58rOaR aFlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fKv4tslN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 28-20020a63175c000000b005c6bab48f48si7583409pgx.111.2023.12.12.05.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 05:07:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fKv4tslN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E9CCF808A36F; Tue, 12 Dec 2023 05:07:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376512AbjLLNHe (ORCPT + 99 others); Tue, 12 Dec 2023 08:07:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbjLLNHc (ORCPT ); Tue, 12 Dec 2023 08:07:32 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EFB3A8; Tue, 12 Dec 2023 05:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Xbzg90/bq4JsbK+dNE7Eb/swVSGtySgf43OD8igrkzw=; b=fKv4tslN6ob6fVBvqGgRBleUK3 ixwy1JJ4P+Dc6t/nAbUZeYdRQy05gz2GKaQOhGEI3/K7k80k40bsrIwIHldZt5RwiCD+XcSaBlfrX fU361clZ1RiKJY7+55mDsoc4Lb41E9t0PDs7z254jvFOegx2oAjVMr6IKS6JEXsisdpFxiqntc2S+ 5L+fZtwVp3sfL+Rkzsk8oP7uf40+jvMr1+kIHrDUu5f4BbCx1E8oP0jtA43OTru5hy9rWJR5dZeep 1lsXlmqM7P8///m8p0g2ZcYJy6A+nF7smgZ0dkmFvIGG4x6rDFKrtZIE4ji20a5Q8zEqoDvz8g3Kf +5KRU6OA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rD2U2-00Bkt3-0U; Tue, 12 Dec 2023 13:07:34 +0000 Date: Tue, 12 Dec 2023 05:07:34 -0800 From: Christoph Hellwig To: Jason Gunthorpe Cc: Mina Almasry , Shailend Chand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Jeroen de Borst , Praveen Kaligineedi , Jesper Dangaard Brouer , Ilias Apalodimas , Arnd Bergmann , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Yunsheng Lin , Harshitha Ramamurthy , Shakeel Butt , Willem de Bruijn , Kaiyuan Zhang , Christoph Hellwig Subject: Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider Message-ID: References: <20231208005250.2910004-1-almasrymina@google.com> <20231208005250.2910004-9-almasrymina@google.com> <20231212122535.GA3029808@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212122535.GA3029808@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 05:07:50 -0800 (PST) On Tue, Dec 12, 2023 at 08:25:35AM -0400, Jason Gunthorpe wrote: > > +static inline struct page_pool_iov *page_to_page_pool_iov(struct page *page) > > +{ > > + if (page_is_page_pool_iov(page)) > > + return (struct page_pool_iov *)((unsigned long)page & ~PP_IOV); > > + > > + DEBUG_NET_WARN_ON_ONCE(true); > > + return NULL; > > +} > > We already asked not to do this, please do not allocate weird things > can call them 'struct page' when they are not. It undermines the > maintainability of the mm to have things mis-typed like > this. Introduce a new type for your thing so the compiler can check it > properly. Yes. Or even better avoid this mess entirely..