2023-08-20 01:20:24

by Qi Zheng

[permalink] [raw]
Subject: Re: [PATCH v4 01/48] mm: move some shrinker-related function declarations to mm/internal.h



On 2023/8/15 16:36, Muchun Song wrote:
>
>
>> On Aug 7, 2023, at 19:08, Qi Zheng <[email protected]> wrote:
>>
>> The following functions are only used inside the mm subsystem, so it's
>> better to move their declarations to the mm/internal.h file.
>>
>> 1. shrinker_debugfs_add()
>> 2. shrinker_debugfs_detach()
>> 3. shrinker_debugfs_remove()
>>
>> Signed-off-by: Qi Zheng <[email protected]>
>
> Reviewed-by: Muchun Song <[email protected]>
>
> One nit bellow.
>
> [...]
>
>> +
>> +/*
>> + * shrinker related functions
>> + */
>
> This is a multi-comment format. "/* shrinker related functions. */" is
> the right one-line format of comment.

Will do.

Thanks,
Qi

>
>> +
>> +#ifdef CONFIG_SHRINKER_DEBUG
>> +extern int shrinker_debugfs_add(struct shrinker *shrinker);
>> +extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
>> + int *debugfs_id);
>> +extern void shrinker_debugfs_remove(struct dentry *debugfs_entry,
>> + int debugfs_id);
>> +#else /* CONFIG_SHRINKER_DEBUG */
>> +static inline int shrinker_debugfs_add(struct shrinker *shrinker)
>> +{
>> + return 0;
>> +}
>> +static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
>> + int *debugfs_id)
>> +{
>> + *debugfs_id = -1;
>> + return NULL;
>> +}
>> +static inline void shrinker_debugfs_remove(struct dentry *debugfs_entry,
>> + int debugfs_id)
>> +{
>> +}
>> +#endif /* CONFIG_SHRINKER_DEBUG */
>> +
>> #endif /* __MM_INTERNAL_H */
>> --
>> 2.30.2
>>
>