* [fuse:dax 19/20] fs/fuse/dax.c:1113:6: warning: variable 'window_offset' set but not used
@ 2020-08-28 23:18 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-28 23:18 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4856 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git dax
head: eb9a9cb4fb34076039ebb3c20513b3ebb99a25ed
commit: 9e48d37275d5b4706d29ac4dcb8a1c9bdbfd9538 [19/20] fuse: move dax code to a separate source file
config: powerpc64-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 9e48d37275d5b4706d29ac4dcb8a1c9bdbfd9538
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/fuse/dax.c: In function 'try_to_free_dmap_chunks':
>> fs/fuse/dax.c:1113:6: warning: variable 'window_offset' set but not used [-Wunused-but-set-variable]
1113 | u64 window_offset = 0;
| ^~~~~~~~~~~~~
fs/fuse/dax.c: In function 'fuse_dax_mem_range_init':
>> fs/fuse/dax.c:1202:14: warning: variable 'phys_addr' set but not used [-Wunused-but-set-variable]
1202 | phys_addr_t phys_addr;
| ^~~~~~~~~
# https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?id=9e48d37275d5b4706d29ac4dcb8a1c9bdbfd9538
git remote add fuse https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git
git fetch --no-tags fuse dax
git checkout 9e48d37275d5b4706d29ac4dcb8a1c9bdbfd9538
vim +/window_offset +1113 fs/fuse/dax.c
1106
1107 static int try_to_free_dmap_chunks(struct fuse_conn *fc,
1108 unsigned long nr_to_free)
1109 {
1110 struct fuse_dax_mapping *dmap, *pos, *temp;
1111 int ret, nr_freed = 0;
1112 unsigned long start_idx = 0, end_idx = 0;
> 1113 u64 window_offset = 0;
1114 struct inode *inode = NULL;
1115
1116 /* Pick first busy range and free it for now*/
1117 while (1) {
1118 if (nr_freed >= nr_to_free)
1119 break;
1120
1121 dmap = NULL;
1122 spin_lock(&fc->lock);
1123
1124 if (!fc->nr_busy_ranges) {
1125 spin_unlock(&fc->lock);
1126 return 0;
1127 }
1128
1129 list_for_each_entry_safe(pos, temp, &fc->busy_ranges,
1130 busy_list) {
1131 /* skip this range if it's in use. */
1132 if (refcount_read(&pos->refcnt) > 1)
1133 continue;
1134
1135 inode = igrab(pos->inode);
1136 /*
1137 * This inode is going away. That will free
1138 * up all the ranges anyway, continue to
1139 * next range.
1140 */
1141 if (!inode)
1142 continue;
1143 /*
1144 * Take this element off list and add it tail. If
1145 * this element can't be freed, it will help with
1146 * selecting new element in next iteration of loop.
1147 */
1148 dmap = pos;
1149 list_move_tail(&dmap->busy_list, &fc->busy_ranges);
1150 start_idx = end_idx = dmap->itn.start;
1151 window_offset = dmap->window_offset;
1152 break;
1153 }
1154 spin_unlock(&fc->lock);
1155 if (!dmap)
1156 return 0;
1157
1158 ret = lookup_and_reclaim_dmap(fc, inode, start_idx, end_idx);
1159 iput(inode);
1160 if (ret)
1161 return ret;
1162 nr_freed++;
1163 }
1164 return 0;
1165 }
1166
1167 void fuse_dax_free_mem_worker(struct work_struct *work)
1168 {
1169 int ret;
1170 struct fuse_conn *fc = container_of(work, struct fuse_conn,
1171 dax_free_work.work);
1172 ret = try_to_free_dmap_chunks(fc, FUSE_DAX_RECLAIM_CHUNK);
1173 if (ret) {
1174 pr_debug("fuse: try_to_free_dmap_chunks() failed with err=%d\n",
1175 ret);
1176 }
1177
1178 /* If number of free ranges are still below threhold, requeue */
1179 kick_dmap_free_worker(fc, 1);
1180 }
1181
1182 void fuse_free_dax_mem_ranges(struct fuse_conn *fc)
1183 {
1184 struct fuse_dax_mapping *range, *temp;
1185
1186 /* Free All allocated elements */
1187 list_for_each_entry_safe(range, temp, &fc->free_ranges, list) {
1188 list_del(&range->list);
1189 if (!list_empty(&range->busy_list))
1190 list_del(&range->busy_list);
1191 kfree(range);
1192 }
1193 }
1194
1195 #ifdef CONFIG_FS_DAX
1196 int fuse_dax_mem_range_init(struct fuse_conn *fc, struct dax_device *dax_dev)
1197 {
1198 long nr_pages, nr_ranges;
1199 void *kaddr;
1200 pfn_t pfn;
1201 struct fuse_dax_mapping *range;
> 1202 phys_addr_t phys_addr;
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 70368 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-28 23:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28 23:18 [fuse:dax 19/20] fs/fuse/dax.c:1113:6: warning: variable 'window_offset' set but not used kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.