All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Matthew Wilcox <willy@infradead.org>
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
Date: Sun, 18 Apr 2021 14:21:21 +0300	[thread overview]
Message-ID: <YHwWMfgqiRaKS2y6@apalos.home> (raw)
In-Reply-To: <20210417202240.GS2531743@casper.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 <ilias.apalodimas@linaro.org>

WARNING: multiple messages have this Message-ID (diff)
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: arnd@kernel.org, grygorii.strashko@ti.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org, mhocko@kernel.org,
	linux-mm@kvack.org, mgorman@suse.de, brouer@redhat.com,
	mcroce@linux.microsoft.com, linux-snps-arc@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, hch@lst.de,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems
Date: Sun, 18 Apr 2021 14:21:21 +0300	[thread overview]
Message-ID: <YHwWMfgqiRaKS2y6@apalos.home> (raw)
In-Reply-To: <20210417202240.GS2531743@casper.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 <ilias.apalodimas@linaro.org>

WARNING: multiple messages have this Message-ID (diff)
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Matthew Wilcox <willy@infradead.org>
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
Date: Sun, 18 Apr 2021 14:21:21 +0300	[thread overview]
Message-ID: <YHwWMfgqiRaKS2y6@apalos.home> (raw)
In-Reply-To: <20210417202240.GS2531743@casper.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 <ilias.apalodimas@linaro.org>

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

WARNING: multiple messages have this Message-ID (diff)
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Matthew Wilcox <willy@infradead.org>
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
Date: Sun, 18 Apr 2021 14:21:21 +0300	[thread overview]
Message-ID: <YHwWMfgqiRaKS2y6@apalos.home> (raw)
In-Reply-To: <20210417202240.GS2531743@casper.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 <ilias.apalodimas@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-04-18 11:21 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 23:07 [PATCH 0/2] Change struct page layout for page_pool Matthew Wilcox (Oracle)
2021-04-16 23:07 ` Matthew Wilcox (Oracle)
2021-04-16 23:07 ` Matthew Wilcox (Oracle)
2021-04-16 23:07 ` Matthew Wilcox (Oracle)
2021-04-16 23:07 ` [PATCH 1/2] mm: Fix struct page layout on 32-bit systems Matthew Wilcox (Oracle)
2021-04-16 23:07   ` Matthew Wilcox (Oracle)
2021-04-16 23:07   ` Matthew Wilcox (Oracle)
2021-04-16 23:07   ` Matthew Wilcox (Oracle)
2021-04-17  1:08   ` kernel test robot
2021-04-17  1:08     ` kernel test robot
2021-04-17  1:08     ` kernel test robot
2021-04-17  1:08     ` kernel test robot
2021-04-17  2:45   ` Matthew Wilcox
2021-04-17  2:45     ` Matthew Wilcox
2021-04-17  2:45     ` Matthew Wilcox
2021-04-17  2:45     ` Matthew Wilcox
2021-04-17 18:32     ` Ilias Apalodimas
2021-04-17 18:32       ` Ilias Apalodimas
2021-04-17 18:32       ` Ilias Apalodimas
2021-04-17 18:32       ` Ilias Apalodimas
2021-04-17 20:22       ` Matthew Wilcox
2021-04-17 20:22         ` Matthew Wilcox
2021-04-17 20:22         ` Matthew Wilcox
2021-04-17 20:22         ` Matthew Wilcox
2021-04-18 11:21         ` Ilias Apalodimas [this message]
2021-04-18 11:21           ` Ilias Apalodimas
2021-04-18 11:21           ` Ilias Apalodimas
2021-04-18 11:21           ` Ilias Apalodimas
2021-04-17 21:18     ` David Laight
2021-04-17 21:18       ` David Laight
2021-04-17 21:18       ` David Laight
2021-04-17 21:18       ` David Laight
2021-04-17 21:18       ` David Laight
2021-04-17 22:45       ` Matthew Wilcox
2021-04-17 22:45         ` Matthew Wilcox
2021-04-17 22:45         ` Matthew Wilcox
2021-04-17 22:45         ` Matthew Wilcox
2021-04-17 22:45         ` Matthew Wilcox
2021-04-20  2:48     ` Vineet Gupta
2021-04-20  2:48       ` Vineet Gupta
2021-04-20  2:48       ` Vineet Gupta
2021-04-20  2:48       ` Vineet Gupta
2021-04-20  2:48       ` Vineet Gupta
2021-04-20  3:10       ` Matthew Wilcox
2021-04-20  3:10         ` Matthew Wilcox
2021-04-20  3:10         ` Matthew Wilcox
2021-04-20  3:10         ` Matthew Wilcox
2021-04-20  3:10         ` Matthew Wilcox
2021-04-20  7:07         ` Arnd Bergmann
2021-04-20  7:07           ` Arnd Bergmann
2021-04-20  7:07           ` Arnd Bergmann
2021-04-20  7:07           ` Arnd Bergmann
2021-04-20  7:07           ` Arnd Bergmann
2021-04-20 21:14           ` Vineet Gupta
2021-04-20 21:14             ` Vineet Gupta
2021-04-20 21:14             ` Vineet Gupta
2021-04-20 21:14             ` Vineet Gupta
2021-04-20 21:14             ` Vineet Gupta
2021-04-20 21:20             ` Arnd Bergmann
2021-04-20 21:20               ` Arnd Bergmann
2021-04-20 21:20               ` Arnd Bergmann
2021-04-20 21:20               ` Arnd Bergmann
2021-04-20 21:20               ` Arnd Bergmann
2021-04-21  5:50               ` hch
2021-04-21  5:50                 ` hch
2021-04-21  5:50                 ` hch
2021-04-21  5:50                 ` hch
2021-04-21  5:50                 ` hch
2021-04-21  8:43               ` David Laight
2021-04-21  8:43                 ` David Laight
2021-04-21  8:43                 ` David Laight
2021-04-21  8:43                 ` David Laight
2021-04-21  8:43                 ` David Laight
2021-04-21  8:58                 ` Arnd Bergmann
2021-04-21  8:58                   ` Arnd Bergmann
2021-04-21  8:58                   ` Arnd Bergmann
2021-04-21  8:58                   ` Arnd Bergmann
2021-04-21  8:58                   ` Arnd Bergmann
2021-04-20  7:39     ` Geert Uytterhoeven
2021-04-20  7:39       ` Geert Uytterhoeven
2021-04-20  7:39       ` Geert Uytterhoeven
2021-04-20  7:39       ` Geert Uytterhoeven
2021-04-20  7:39       ` Geert Uytterhoeven
2021-04-20  8:39       ` David Laight
2021-04-20  8:39         ` David Laight
2021-04-20  8:39         ` David Laight
2021-04-20  8:39         ` David Laight
2021-04-20 11:32       ` Matthew Wilcox
2021-04-20 11:32         ` Matthew Wilcox
2021-04-20 11:32         ` Matthew Wilcox
2021-04-20 11:32         ` Matthew Wilcox
2021-04-17  7:34   ` Jesper Dangaard Brouer
2021-04-17  7:34     ` Jesper Dangaard Brouer
2021-04-17  7:34     ` Jesper Dangaard Brouer
2021-04-17  7:34     ` Jesper Dangaard Brouer
2021-04-20  7:21   ` Rasmus Villemoes
2021-04-20  7:21     ` Rasmus Villemoes
2021-04-20  7:21     ` Rasmus Villemoes
2021-04-20  7:21     ` Rasmus Villemoes
2021-04-16 23:07 ` [PATCH 2/2] mm: Indicate pfmemalloc pages in compound_head Matthew Wilcox (Oracle)
2021-04-16 23:07   ` Matthew Wilcox (Oracle)
2021-04-16 23:07   ` Matthew Wilcox (Oracle)
2021-04-16 23:07   ` Matthew Wilcox (Oracle)
2021-04-17 21:13   ` David Laight
2021-04-17 21:13     ` David Laight
2021-04-17 21:13     ` David Laight
2021-04-17 21:13     ` David Laight
2021-04-17 21:13     ` David Laight
2021-04-17 21:28     ` Matthew Wilcox
2021-04-17 21:28       ` Matthew Wilcox
2021-04-17 21:28       ` Matthew Wilcox
2021-04-17 21:28       ` Matthew Wilcox
2021-04-17 21:28       ` Matthew Wilcox
2021-04-20  4:03 ` [PATCH 0/2] Change struct page layout for page_pool Michael Ellerman
2021-04-20  4:03   ` Michael Ellerman
2021-04-20  4:03   ` Michael Ellerman
2021-04-20  4:03   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHwWMfgqiRaKS2y6@apalos.home \
    --to=ilias.apalodimas@linaro.org \
    --cc=arnd@kernel.org \
    --cc=brouer@redhat.com \
    --cc=grygorii.strashko@ti.com \
    --cc=hch@lst.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mcroce@linux.microsoft.com \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.