Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1704537pxb; Sun, 18 Apr 2021 04:24:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOT+s+5droIJLsTYK40sH50XElBF7wl4BEETbIT6CF475DayiGG+6/vXlOVCLYZcdVLXBz X-Received: by 2002:a17:906:eb43:: with SMTP id mc3mr2258586ejb.78.1618745088082; Sun, 18 Apr 2021 04:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618745088; cv=none; d=google.com; s=arc-20160816; b=uEMxz6Hdsb1mA8h5bh/9drVxrwRJcYXyW+TpSidBrNL8zKuEr6WUc0FfrzGPfmbJLZ FDD7EM1axXKOgYBtF5frEbCuMutHuRWdWnoRxqgK+YttyFLB5wYFkF0Xx1AvOQKhr/JV l+gYNaexbn8i0vu5pU42KoiL1pUV0pD7/CJjb4S9C9mkLl0sIulg+YfIXXZOvjQqek5j 4ZKwDn9BDM7SD6V/JE1yrVj3Wh+olvnsr1UZ1L6Hhb03quOEQCREEWAMv2BW8WshTgqj WWzv7uTjvSK2zDdb41Vy6Xy7HPYzoScpVFEtETqy+6RDT+3laAghr6bryBys5vbhhfd2 uFOg== 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=yHuFjlT5rtKQaeRAFhvfUQECvltMrb+hYlCuEQGxGSA=; b=LThMlSrXbWDNgfWHKx4i1sdnJCmmnipoQL0dGNwM3ffIxD1nEaDhu7NkORmVfmSoCm Euh728dM8l21H6WZfU2ryuqQoYPTbfbC3WywKSkVcumzxWTJoHYdxCOzbrcuaPsN6db+ Z4NyEo6MmFA1NG+c9+wlMLZXP4dZuf2OA5ozxyRSfRzm6hGIBFoDrUnQwKQ/L5duVfG4 I7EVlJBMIFGkztpQS07cQl+s9hygevSyvsbx4C/+x5eOI/vZqKL6y8JrpHO5igTjfXKb Yv3VgPjcmQ4OVnnEerHj7d4JadEm5Kb070YJUZy4IwycWl72fucd0bI1fOS5nKQYcm7n pOiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n705a9a7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si9294596eju.252.2021.04.18.04.24.25; Sun, 18 Apr 2021 04:24:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n705a9a7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbhDRLV4 (ORCPT + 99 others); Sun, 18 Apr 2021 07:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231220AbhDRLVz (ORCPT ); Sun, 18 Apr 2021 07:21:55 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 854DDC06174A for ; Sun, 18 Apr 2021 04:21:26 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id x7so31018540wrw.10 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=tQns+U2Kd3picretz6V74u6Oa9dCossKHouGgWXWQW1tXr2+y6G3MqT/6KB9E6MUpf iTbMCUmBaOhpMrG6KymFW0Ws8AfSH1zaVOqA1fe71BgSvDdhakV5J2Q9vNclYsdPr47g Y0pPxoQnE5MpjKLehgHSlDJFJJOhIuMGUy2RcKRa7oFk7W26i9RUeY2cMxATPCPTfvMW NamDB/Ka5iBBtAhCwB+1qhYf2CBtoSaFf1xcRzGgXtyTRJSiRHVO8wtAhGVunlnH7QNR tHGTuERTj5RyFqiMJNEmQ8FaVVYv3hRPR1QLIGteaf0Iywh135BsU70fy+jmeC7gEyrl KWIQ== X-Gm-Message-State: AOAM532oE7K2ymqaUqXZB1TEgUF6Z/qg579ksmu2Zvk6IOon0BTcCWyi w8MUWRHVnz2+fAawBBBCgTZAkQ== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210417202240.GS2531743@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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