Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2018 13:45:49 -0500
From:      Alan Cox <alc@rice.edu>
To:        "O. Hartmann" <ohartmann@walstatt.org>, Alan Cox <alc@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r338018 - head/sys/vm
Message-ID:  <f3cddfc0-e265-1a8c-e155-d66c0d4cf9ab@rice.edu>
In-Reply-To: <20180820203633.1bd75a2e@thor.intern.walstatt.dynvpn.de>
References:  <201808181833.w7IIXodt040289@repo.freebsd.org> <20180820203633.1bd75a2e@thor.intern.walstatt.dynvpn.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/20/2018 13:36, O. Hartmann wrote:
> Am Sat, 18 Aug 2018 18:33:50 +0000 (UTC)
> Alan Cox <alc@FreeBSD.org> schrieb:
>
> > Author: alc
> > Date: Sat Aug 18 18:33:50 2018
> > New Revision: 338018
> > URL: https://svnweb.freebsd.org/changeset/base/338018
>
> > Log:
> >   Eliminate the arena parameter to kmem_malloc_domain().  It is
> redundant.
> >   The domain and flags parameters suffice.  In fact, the related
> functions
> >   kmem_alloc_{attr,contig}_domain() don't have an arena parameter.
>
> >   Reviewed by:    kib, markj
> >   Differential Revision:    https://reviews.freebsd.org/D16713
>
> > Modified:
> >   head/sys/vm/uma_core.c
> >   head/sys/vm/vm_extern.h
> >   head/sys/vm/vm_kern.c
>
> > Modified: head/sys/vm/uma_core.c
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> > --- head/sys/vm/uma_core.c    Sat Aug 18 16:03:15 2018    (r338017)
> > +++ head/sys/vm/uma_core.c    Sat Aug 18 18:33:50 2018    (r338018)
> > @@ -1169,7 +1169,7 @@ page_alloc(uma_zone_t zone, vm_size_t bytes,
> int domai
> >      void *p;    /* Returned page */
>
> >      *pflag =3D UMA_SLAB_KERNEL;
> > -    p =3D (void *) kmem_malloc_domain(kernel_arena, domain, bytes, w=
ait);
> > +    p =3D (void *) kmem_malloc_domain(domain, bytes, wait);
>
> >      return (p);
> >  }
> > @@ -3680,32 +3680,22 @@ uma_zone_exhausted_nolock(uma_zone_t zone)
> >  void *
> >  uma_large_malloc_domain(vm_size_t size, int domain, int wait)
> >  {
> > -    struct vmem *arena;
> >      vm_offset_t addr;
> >      uma_slab_t slab;
>
> > -#if VM_NRESERVLEVEL > 0
> > -    if (__predict_true((wait & M_EXEC) =3D=3D 0))
> > -        arena =3D kernel_arena;
> > -    else
> > -        arena =3D kernel_rwx_arena;
> > -#else
> > -    arena =3D kernel_arena;
> > -#endif
> > -
> >      slab =3D zone_alloc_item(slabzone, NULL, domain, wait);
> >      if (slab =3D=3D NULL)
> >          return (NULL);
> >      if (domain =3D=3D UMA_ANYDOMAIN)
> > -        addr =3D kmem_malloc(arena, size, wait);
> > +        addr =3D kmem_malloc(NULL, size, wait);
> >      else
> > -        addr =3D kmem_malloc_domain(arena, domain, size, wait);
> > +        addr =3D kmem_malloc_domain(domain, size, wait);
> >      if (addr !=3D 0) {
> >          vsetslab(addr, slab);
> >          slab->us_data =3D (void *)addr;
> >          slab->us_flags =3D UMA_SLAB_KERNEL | UMA_SLAB_MALLOC;
> >  #if VM_NRESERVLEVEL > 0
> > -        if (__predict_false(arena =3D=3D kernel_rwx_arena))
> > +        if (__predict_false((wait & M_EXEC) !=3D 0))
> >              slab->us_flags |=3D UMA_SLAB_KRWX;
> >  #endif
> >          slab->us_size =3D size;
>
> > Modified: head/sys/vm/vm_extern.h
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> > --- head/sys/vm/vm_extern.h    Sat Aug 18 16:03:15 2018    (r338017)
> > +++ head/sys/vm/vm_extern.h    Sat Aug 18 18:33:50 2018    (r338018)
> > @@ -65,8 +65,7 @@ vm_offset_t kmem_alloc_contig_domain(int domain, vm=
_si
> >      vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t
> boundary,
> >      vm_memattr_t memattr);
> >  vm_offset_t kmem_malloc(struct vmem *, vm_size_t size, int flags);
> > -vm_offset_t kmem_malloc_domain(struct vmem *, int domain, vm_size_t
> size,
> > -    int flags);
> > +vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags=
);
> >  void kmem_free(struct vmem *, vm_offset_t, vm_size_t);
>
> >  /* This provides memory for previously allocated address space. */
>
> > Modified: head/sys/vm/vm_kern.c
> >
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> > --- head/sys/vm/vm_kern.c    Sat Aug 18 16:03:15 2018    (r338017)
> > +++ head/sys/vm/vm_kern.c    Sat Aug 18 18:33:50 2018    (r338018)
> > @@ -372,23 +372,18 @@ kmem_suballoc(vm_map_t parent, vm_offset_t
> *min, vm_of
> >   *    Allocate wired-down pages in the kernel's address space.
> >   */
> >  vm_offset_t
> > -kmem_malloc_domain(struct vmem *vmem, int domain, vm_size_t size,
> int flags)
> > +kmem_malloc_domain(int domain, vm_size_t size, int flags)
> >  {
> >      vmem_t *arena;
> >      vm_offset_t addr;
> >      int rv;
>
> >  #if VM_NRESERVLEVEL > 0
> > -    KASSERT(vmem =3D=3D kernel_arena || vmem =3D=3D kernel_rwx_arena=
,
> > -        ("kmem_malloc_domain: Only kernel_arena or kernel_rwx_arena =
"
> > -        "are supported."));
> > -    if (__predict_true(vmem =3D=3D kernel_arena))
> > +    if (__predict_true((flags & M_EXEC) =3D=3D 0))
> >          arena =3D vm_dom[domain].vmd_kernel_arena;
> >      else
> >          arena =3D vm_dom[domain].vmd_kernel_rwx_arena;
> >  #else
> > -    KASSERT(vmem =3D=3D kernel_arena,
> > -        ("kmem_malloc_domain: Only kernel_arena is supported."));
> >      arena =3D vm_dom[domain].vmd_kernel_arena;
> >  #endif
> >      size =3D round_page(size);
> > @@ -404,7 +399,7 @@ kmem_malloc_domain(struct vmem *vmem, int
> domain, vm_s
> >  }
>
> >  vm_offset_t
> > -kmem_malloc(struct vmem *vmem, vm_size_t size, int flags)
> > +kmem_malloc(struct vmem *vmem __unused, vm_size_t size, int flags)
> >  {
> >      struct vm_domainset_iter di;
> >      vm_offset_t addr;
> > @@ -412,7 +407,7 @@ kmem_malloc(struct vmem *vmem, vm_size_t size,
> int fla
>
> >      vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flag=
s);
> >      do {
> > -        addr =3D kmem_malloc_domain(vmem, domain, size, flags);
> > +        addr =3D kmem_malloc_domain(domain, size, flags);
> >          if (addr !=3D 0)
> >              break;
> >      } while (vm_domainset_iter_malloc(&di, &domain, &flags) =3D=3D 0=
);
> > _______________________________________________
> > svn-src-head@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or=
g"
>
> This change has implications at least for port
>
> x11/nvidia-driver (390.77)
>
> which now fails in nvidia_subr.c:1131:41
> and
> nvidia_subr.c:1269:45:
>
> to compile.
>
> See PR 230780
>
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230780
>
>
>
Thank you.  I have posted instructions to the PR on how to address this.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f3cddfc0-e265-1a8c-e155-d66c0d4cf9ab>