linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Soheil Hassas Yeganeh <soheil@google.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Arjun Roy <arjunroy.kdev@gmail.com>,
	David Miller <davem@davemloft.net>,
	 akpm@linux-foundation.org, linux-mm <linux-mm@kvack.org>,
	 Arjun Roy <arjunroy@google.com>,
	Eric Dumazet <edumazet@google.com>,
	 Stephen Rothwell <sfr@canb.auug.org.au>,
	geert@linux-m68k.org
Subject: Re: [PATCH v3 mm 2/2] mm: vm_insert_pages() checks if pte_index defined.
Date: Fri, 28 Feb 2020 12:22:48 -0500	[thread overview]
Message-ID: <CACSApvbEdiL73=bSrN8ve9xFARPE9Hc3AO-RozOayFES2R_TUQ@mail.gmail.com> (raw)
In-Reply-To: <20200228133803.GO31668@ziepe.ca>

On Fri, Feb 28, 2020 at 8:38 AM Jason Gunthorpe <jgg@ziepe.ca> wrote:
>
> On Thu, Feb 27, 2020 at 09:47:14PM -0800, Arjun Roy wrote:
> > diff --git a/mm/memory.c b/mm/memory.c
> > index d6f834f7d145..47b28fcc73c2 100644
> > +++ b/mm/memory.c
> > @@ -1460,18 +1460,6 @@ static int insert_page_into_pte_locked(struct mm_struct *mm, pte_t *pte,
> >       return 0;
> >  }
> >
> > -static int insert_page_in_batch_locked(struct mm_struct *mm, pmd_t *pmd,
> > -                     unsigned long addr, struct page *page, pgprot_t prot)
> > -{
> > -     int err;
> > -
> > -     if (!page_count(page))
> > -             return -EINVAL;
> > -     err = validate_page_before_insert(page);
> > -     return err ? err : insert_page_into_pte_locked(
> > -             mm, pte_offset_map(pmd, addr), addr, page, prot);
> > -}
> > -
> >  /*
> >   * This is the old fallback for page remapping.
> >   *
> > @@ -1500,8 +1488,21 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
> >       return retval;
> >  }
> >
> > +#ifdef pte_index
>
> It seems a bit weird like this, don't we usually do this kind of stuff
> with some CONFIG_ARCH_HAS_XX thing?
>
> IMHO all arches should implement pte_index as the static inline, that
> has been the general direction lately.

Based on a comment from Stephen Rothwell, we found out that "static
inline" functions are only used in tile and x86.  That's why Arjun
opted for this method to create a smaller patch-series to fix the
build breakage.

Thanks,
Soheil

> Jason


      reply	other threads:[~2020-02-28 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  5:47 [PATCH v3 mm 1/2] mm: Define pte_index as macro for x86 Arjun Roy
2020-02-28  5:47 ` [PATCH v3 mm 2/2] mm: vm_insert_pages() checks if pte_index defined Arjun Roy
2020-02-28 13:38   ` Jason Gunthorpe
2020-02-28 17:22     ` Soheil Hassas Yeganeh [this message]

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='CACSApvbEdiL73=bSrN8ve9xFARPE9Hc3AO-RozOayFES2R_TUQ@mail.gmail.com' \
    --to=soheil@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjunroy.kdev@gmail.com \
    --cc=arjunroy@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=geert@linux-m68k.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-mm@kvack.org \
    --cc=sfr@canb.auug.org.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).