Re: [PATCH] ext4: replace kmem_cache_create with KMEM_CACHE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Biggers <ebiggers@xxxxxxxxxx> 于2022年11月10日周四 10:47写道:
>
> On Thu, Nov 10, 2022 at 08:53:26AM +0800, JunChao Sun wrote:
> > Yeah, maybe we should remove the SLAB_RECLAIM_ACCOUNT flag for static
> > slab, and 16828088f9e51815 ("ext4: use KMEM_CACHE instead of
> > kmem_cache_create") have done so. But should we remove
> > SLAB_RECLAIM_ACCOUNT in this patch or belong to a separate patch?
>
> I'd just keep the slab flags the same in this patch.  If any flags do need to be
> changed, that should be a separate patch.
>
>
> > I think SLAB_RECLAIM_ACCOUNT is meant for for things that are directly
> > reclaimable, such as struct ext4_inode_info.  Inodes are evictable, and when
> > that happens, the corresponding struct ext4_inode_info gets freed.
> >
> > bio_post_read_ctx_cache probably should use SLAB_TEMPORARY instead, since it is
> > only used for temporary structures during I/O.
How to decide whether to use SLAB_RECLAIM_ACCOUNT or not when creating
a slab cache? Is it based on whether the object is reclaimable or
evictable, or the amount of memory the object may use? If the first,
how to know whether an object is reclaimable or evictable?
Btw, I saw that ext4 called ext4_es_register_shrinker() to register
shrinker for struct extent_status, so SLAB_RECLAIM_ACCOUNT should be
used when creating ext4_es_cachep, right?
>
> That being said, SLAB_TEMPORARY is currently #define'd to SLAB_RECLAIM_ACCOUNT,
> so currently it makes no difference in practice...
>
> - Eric




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux