From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04F7AC433ED for ; Sun, 18 Apr 2021 11:23:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 784B261207 for ; Sun, 18 Apr 2021 11:23:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 784B261207 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/737YPUx++Ey+y3vnov3//3ehkE4heoL6WB1Emvdrbw=; b=gQwX2FAtgmeHOvZb5zihmn1u4 5pwzc8h9jwhSj26HRpeMJiYoCX/ZQX8zXR5jWTIZOOCWfFYRnHPQ3QH/r6DFUdNEt3XtmXKavkRF2 LkE6HQMHu/X7m7E3p3AXwFL7eJ3Ug6KdP78dPrICfYWRaPSRihZMWZJT4yaMWu42BcwRoOYhQdimy oB6CtN7mCia1Pf9xdLbNZfGyy5kIYYrUDuag6WcJTkZQIoih0zU2LxONVi7RxCv0PPIhtQtz4LmLF /OG12OG/1A5zghpwa8cs3ulTC8W1sDqkkTS5Xyx7XYpBBILuw17FjmGnm/qdliJ7G7x8JDsl7s0PP nspoAEOHA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lY5Ue-007o1q-1U; Sun, 18 Apr 2021 11:21:36 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lY5Ub-007o10-3X for linux-arm-kernel@desiato.infradead.org; Sun, 18 Apr 2021 11:21:33 +0000 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=yHuFjlT5rtKQaeRAFhvfUQECvltMrb+hYlCuEQGxGSA=; b=yNRnVNzVIFOZ97ESGsM0nSPcot o9zkNvBHJf8baMCVqxfOm7kAJQ7NR7dgdGufzvieF5pOCcQ7ATS+geedmH2MQCfN1yTZYUDZu3Rvv fbrRitGRBlGn5Y/mpL6hscvKEGkO90oGl7+dKBWC9TjMSlvM2HMcUL6Wg92Oe/7B4oPNC74RHlBTR Rgfupmin12AdTQsqJgKkMclrH9pV1+qmd3XU5qgJC3OAkhpyNLKSyON6FrkRaX4Xs2DVEEZPpMAGx S0VqJsP9kAajMYS68xbS22x9W2CmXbQ31VXrkN5Tj7JVTE94jzG/s6mAkJJbN+ADk6yAIKMPJe2C7 YsqI88pw==; Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lY5UU-00AP4D-Rl for linux-arm-kernel@lists.infradead.org; Sun, 18 Apr 2021 11:21:31 +0000 Received: by mail-wr1-x432.google.com with SMTP id w4so27319653wrt.5 for ; Sun, 18 Apr 2021 04:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yHuFjlT5rtKQaeRAFhvfUQECvltMrb+hYlCuEQGxGSA=; b=n705a9a7qdxMFuWE1zX7H+Gwn7R1Ph/HxlJsBZM2OwmgI8on3YCAfTIJ9VILLpPGVN U6Ei9bgVBs4WU0tgRYPLY73PulXN7X8T9DnS/lfiOp0hi2PY7rBteW4MAz4+5uRDWIzC tVQA+Ijyf20lSUQ31OC6X057HKNOPi+pz6Nzkf8RmSCB7uub+bAFeTOPAvt2BEhTUPA9 e95vVEysgGXjcAyKsinTriFeM9DFcYVac9rU5mO+CY2n1SfMhFTrdb724lZinw5eig/R DWL2UVgqLZFgwGhAmloMkMPTn1qsrnfB8ZvGBiW/SI8QnW3O/4TL6LEClDzNGo9C+X4Y G8Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yHuFjlT5rtKQaeRAFhvfUQECvltMrb+hYlCuEQGxGSA=; b=knnyP8nQloYdswBv4bKOx0qFl6z2PR4bua4NEHQV6DhbdJTHfEWPmpcrSGMZQjhJNE II7SIzmyGQDIdfU+DzsHdRsvnmQXIp1h+B2Pcfa1DBaiktBA8d+1InRokc57Ia2vgUrs eAHDlExVDxsBiQCHm5OOZdtobnv6uwGnyIZsumeJh+GV3sfVCAegTNRIYhHkbcBhx5da 0nGFNAk6WUHTO0k/tePo3F4VyMIrO5AKmXi3X+6ylZj4RZQzIGrCt5cqr6d5jCSYBg0I rGtwNS3l5QUWpOxqQbczKQDa55NMj3ILl4ZG54KHM2nauQti4/K2lssn0soHCsld+p8y Sm9w== X-Gm-Message-State: AOAM531GrSL3Q+3XoRJAT5frnJ0IzI61xjTpc3ualRGZ/AM3lF3tbGlk tQLQH/wFmS1XJcQW6PGrYoOI8S4lzDRhzg== X-Google-Smtp-Source: ABdhPJy/WC+K/XtmqLOKo5IrEBVbL+R26kxzPf1pRpKWFGvT15zr5cY0imTHGxHtMkaaPLJEz/z5Qw== X-Received: by 2002:a5d:5146:: with SMTP id u6mr8768015wrt.408.1618744885216; Sun, 18 Apr 2021 04:21:25 -0700 (PDT) Received: from apalos.home (ppp-94-65-92-88.home.otenet.gr. [94.65.92.88]) by smtp.gmail.com with ESMTPSA id i12sm17113748wrm.77.2021.04.18.04.21.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 04:21:24 -0700 (PDT) Date: Sun, 18 Apr 2021 14:21:21 +0300 From: Ilias Apalodimas To: Matthew Wilcox Cc: brouer@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, mcroce@linux.microsoft.com, grygorii.strashko@ti.com, arnd@kernel.org, hch@lst.de, linux-snps-arc@lists.infradead.org, mhocko@kernel.org, mgorman@suse.de Subject: Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems Message-ID: References: <20210416230724.2519198-1-willy@infradead.org> <20210416230724.2519198-2-willy@infradead.org> <20210417024522.GP2531743@casper.infradead.org> <20210417202240.GS2531743@casper.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210417202240.GS2531743@casper.infradead.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210418_042126_949952_8BB7843E X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Apr 17, 2021 at 09:22:40PM +0100, Matthew Wilcox wrote: > On Sat, Apr 17, 2021 at 09:32:06PM +0300, Ilias Apalodimas wrote: > > > +static inline void page_pool_set_dma_addr(struct page *page, dma_addr_t addr) > > > +{ > > > + page->dma_addr[0] = addr; > > > + if (sizeof(dma_addr_t) > sizeof(unsigned long)) > > > + page->dma_addr[1] = addr >> 16 >> 16; > > > > The 'error' that was reported will never trigger right? > > I assume this was compiled with dma_addr_t as 32bits (so it triggered the > > compilation error), but the if check will never allow this codepath to run. > > If so can we add a comment explaining this, since none of us will remember why > > in 6 months from now? > > That's right. I compiled it all three ways -- 32-bit, 64-bit dma, 32-bit long > and 64-bit. The 32/64 bit case turn into: > > if (0) > page->dma_addr[1] = addr >> 16 >> 16; > > which gets elided. So the only case that has to work is 64-bit dma and > 32-bit long. > > I can replace this with upper_32_bits(). > Ok up to you, I don't mind either way and thanks for solving this! Acked-by: Ilias Apalodimas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel