linuxkpi: Add synchronize_shrinkers()
It takes the lock and release it immediately to make sure no shrinkers are running in parallel. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38565
This commit is contained in:
parent
53da54b936
commit
8363672729
@ -51,8 +51,10 @@ struct shrinker {
|
||||
|
||||
int linuxkpi_register_shrinker(struct shrinker *s);
|
||||
void linuxkpi_unregister_shrinker(struct shrinker *s);
|
||||
void linuxkpi_synchronize_shrinkers(void);
|
||||
|
||||
#define register_shrinker(s) linuxkpi_register_shrinker(s)
|
||||
#define unregister_shrinker(s) linuxkpi_unregister_shrinker(s)
|
||||
#define synchronize_shrinkers() linuxkpi_synchronize_shrinkers()
|
||||
|
||||
#endif /* _LINUXKPI_LINUX_SHRINKER_H_ */
|
||||
|
@ -64,6 +64,14 @@ linuxkpi_unregister_shrinker(struct shrinker *s)
|
||||
sx_xunlock(&sx_shrinker);
|
||||
}
|
||||
|
||||
void
|
||||
linuxkpi_synchronize_shrinkers(void)
|
||||
{
|
||||
|
||||
sx_xlock(&sx_shrinker);
|
||||
sx_xunlock(&sx_shrinker);
|
||||
}
|
||||
|
||||
#define SHRINKER_BATCH 512
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user