/* Network filesystem caching backend to use cache files on a premounted * filesystem * * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence * as published by the Free Software Foundation; either version * 2 of the Licence, or (at your option) any later version. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "internal.h" unsigned cachefiles_debug; module_param_named(debug, cachefiles_debug, uint, S_IWUSR | S_IRUGO); MODULE_PARM_DESC(cachefiles_debug, "CacheFiles debugging mask"); MODULE_DESCRIPTION("Mounted-filesystem based cache"); MODULE_AUTHOR("Red Hat, Inc."); MODULE_LICENSE("GPL"); struct kmem_cache *cachefiles_object_jar; static struct miscdevice cachefiles_dev = { .minor = MISC_DYNAMIC_MINOR, .name = "cachefiles", .fops = &cachefiles_daemon_fops, }; static void cachefiles_object_init_once(void *_object) { struct cachefiles_object *object = _object; memset(object, 0, sizeof(*object)); spin_lock_init(&object->work_lock); } /* * initialise the fs caching module */ static int __init cachefiles_init(void) { int ret; ret = misc_register(&cachefiles_dev); if (ret < 0) goto error_dev; /* create an object jar */ ret = -ENOMEM; cachefiles_object_jar = kmem_cache_create("cachefiles_object_jar", sizeof(struct cachefiles_object), 0, SLAB_HWCACHE_ALIGN, cachefiles_object_init_once); if (!cachefiles_object_jar) { pr_notice("Failed to allocate an object jar\n"); goto error_object_jar; } ret = cachefiles_proc_init(); if (ret < 0) goto error_proc; pr_info("Loaded\n"); return 0; error_proc: kmem_cache_destroy(cachefiles_object_jar); error_object_jar: misc_deregister(&cachefiles_dev); error_dev: pr_err("failed to register: %d\n", ret); return ret; } fs_initcall(cachefiles_init); /* * clean up on module removal */ static void __exit cachefiles_exit(void) { pr_info("Unloading\n"); cachefiles_proc_cleanup(); kmem_cache_destroy(cachefiles_object_jar); misc_deregister(&cachefiles_dev); } module_exit(cachefiles_exit); den' name='id' value='79c6f448c8b79c321e4a1f31f98194e4f6b6cae7'/>
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-01-30 19:27:10 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-01-31 09:13:49 -0500
commit79c6f448c8b79c321e4a1f31f98194e4f6b6cae7 (patch)
tree370efda701f03cccf21e02bb1fdd3b852547d75c /net/9p/trans_common.c
parent0c744ea4f77d72b3dcebb7a8f2684633ec79be88 (diff)
tracing: Fix hwlat kthread migration
The hwlat tracer creates a kernel thread at start of the tracer. It is pinned to a single CPU and will move to the next CPU after each period of running. If the user modifies the migration thread's affinity, it will not change after that happens. The original code created the thread at the first instance it was called, but later was changed to destroy the thread after the tracer was finished, and would not be created until the next instance of the tracer was established. The code that initialized the affinity was only called on the initial instantiation of the tracer. After that, it was not initialized, and the previous affinity did not match the current newly created one, making it appear that the user modified the thread's affinity when it did not, and the thread failed to migrate again. Cc: stable@vger.kernel.org Fixes: 0330f7aa8ee6 ("tracing: Have hwlat trace migrate across tracing_cpumask CPUs") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'net/9p/trans_common.c')