From owner-svn-src-stable@freebsd.org Tue Mar 13 16:21:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F4BDF2D4F3; Tue, 13 Mar 2018 16:21:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB2E85F70; Tue, 13 Mar 2018 16:21:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDBEF1C162; Tue, 13 Mar 2018 16:20:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DGKxDl001323; Tue, 13 Mar 2018 16:20:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DGKxkD001106; Tue, 13 Mar 2018 16:20:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803131620.w2DGKxkD001106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Mar 2018 16:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330853 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 16:21:00 -0000 Author: hselasky Date: Tue Mar 13 16:20:59 2018 New Revision: 330853 URL: https://svnweb.freebsd.org/changeset/base/330853 Log: MFC r330387 and r330396: Rename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI to be compatible with Linux. Keep the old SLAB_DESTROY_BY_RCU macro definition around in the LinuxKPI to avoid compilation breakage in external kernel modules. Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h stable/11/sys/compat/linuxkpi/common/src/linux_slab.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Tue Mar 13 16:18:38 2018 (r330852) +++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Tue Mar 13 16:20:59 2018 (r330853) @@ -79,9 +79,12 @@ struct linux_kmem_cache { }; #define SLAB_HWCACHE_ALIGN (1 << 0) -#define SLAB_DESTROY_BY_RCU (1 << 1) +#define SLAB_TYPESAFE_BY_RCU (1 << 1) #define SLAB_RECLAIM_ACCOUNT (1 << 2) +#define SLAB_DESTROY_BY_RCU \ + SLAB_TYPESAFE_BY_RCU + static inline gfp_t linux_check_m_flags(gfp_t flags) { @@ -162,7 +165,7 @@ extern void linux_kmem_cache_free_rcu(struct linux_kme static inline void linux_kmem_cache_free(struct linux_kmem_cache *c, void *m) { - if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) linux_kmem_cache_free_rcu(c, m); else uma_zfree(c->cache_zone, m); Modified: stable/11/sys/compat/linuxkpi/common/src/linux_slab.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_slab.c Tue Mar 13 16:18:38 2018 (r330852) +++ stable/11/sys/compat/linuxkpi/common/src/linux_slab.c Tue Mar 13 16:20:59 2018 (r330853) @@ -49,7 +49,7 @@ linux_kmem_ctor(void *mem, int size, void *arg, int fl { struct linux_kmem_cache *c = arg; - if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) { + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { struct linux_kmem_rcu *rcu = LINUX_KMEM_TO_RCU(c, mem); /* duplicate cache pointer */ @@ -85,7 +85,7 @@ linux_kmem_cache_create(const char *name, size_t size, else if (align != 0) align--; - if (flags & SLAB_DESTROY_BY_RCU) { + if (flags & SLAB_TYPESAFE_BY_RCU) { /* make room for RCU structure */ size = ALIGN(size, sizeof(void *)); size += sizeof(struct linux_kmem_rcu); @@ -118,7 +118,7 @@ linux_kmem_cache_free_rcu(struct linux_kmem_cache *c, void linux_kmem_cache_destroy(struct linux_kmem_cache *c) { - if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) { + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { /* make sure all free callbacks have been called */ rcu_barrier(); }