Merge tag 'char-misc-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-microblaze.git] / mm / slab.h
index db9fb5c..4ec82be 100644 (file)
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -380,15 +380,6 @@ void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *s);
 ssize_t slabinfo_write(struct file *file, const char __user *buffer,
                       size_t count, loff_t *ppos);
 
-/*
- * Generic implementation of bulk operations
- * These are useful for situations in which the allocator cannot
- * perform optimizations. In that case segments of the object listed
- * may be allocated or freed using these operations.
- */
-void __kmem_cache_free_bulk(struct kmem_cache *, size_t, void **);
-int __kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **);
-
 static inline enum node_stat_item cache_vmstat_idx(struct kmem_cache *s)
 {
        return (s->flags & SLAB_RECLAIM_ACCOUNT) ?
@@ -547,36 +538,22 @@ static inline void memcg_slab_post_alloc_hook(struct kmem_cache *s,
        obj_cgroup_put(objcg);
 }
 
-static inline void memcg_slab_free_hook(struct kmem_cache *s_orig,
+static inline void memcg_slab_free_hook(struct kmem_cache *s, struct slab *slab,
                                        void **p, int objects)
 {
-       struct kmem_cache *s;
        struct obj_cgroup **objcgs;
-       struct obj_cgroup *objcg;
-       struct slab *slab;
-       unsigned int off;
        int i;
 
        if (!memcg_kmem_enabled())
                return;
 
-       for (i = 0; i < objects; i++) {
-               if (unlikely(!p[i]))
-                       continue;
-
-               slab = virt_to_slab(p[i]);
-               /* we could be given a kmalloc_large() object, skip those */
-               if (!slab)
-                       continue;
-
-               objcgs = slab_objcgs(slab);
-               if (!objcgs)
-                       continue;
+       objcgs = slab_objcgs(slab);
+       if (!objcgs)
+               return;
 
-               if (!s_orig)
-                       s = slab->slab_cache;
-               else
-                       s = s_orig;
+       for (i = 0; i < objects; i++) {
+               struct obj_cgroup *objcg;
+               unsigned int off;
 
                off = obj_to_index(s, slab, p[i]);
                objcg = objcgs[off];
@@ -628,7 +605,7 @@ static inline void memcg_slab_post_alloc_hook(struct kmem_cache *s,
 {
 }
 
-static inline void memcg_slab_free_hook(struct kmem_cache *s,
+static inline void memcg_slab_free_hook(struct kmem_cache *s, struct slab *slab,
                                        void **p, int objects)
 {
 }