Lines Matching refs:wss

147 	struct rvt_wss *wss = rdi->wss;
149 if (!wss)
153 kfree(wss->entries);
154 wss->entries = NULL;
155 kfree(rdi->wss);
156 rdi->wss = NULL;
160 * rvt_wss_init - Init wss data structures
173 struct rvt_wss *wss;
177 rdi->wss = NULL;
181 rdi->wss = kzalloc_node(sizeof(*rdi->wss), GFP_KERNEL, node);
182 if (!rdi->wss)
184 wss = rdi->wss;
208 wss->pages_mask = table_bits - 1;
209 wss->num_entries = table_bits / BITS_PER_LONG;
211 wss->threshold = (llc_bits * wss_threshold) / 100;
212 if (wss->threshold == 0)
213 wss->threshold = 1;
215 wss->clean_period = wss_clean_period;
216 atomic_set(&wss->clean_counter, wss_clean_period);
218 wss->entries = kcalloc_node(wss->num_entries, sizeof(*wss->entries),
220 if (!wss->entries) {
243 static void wss_advance_clean_counter(struct rvt_wss *wss)
250 if (atomic_dec_and_test(&wss->clean_counter)) {
264 atomic_set(&wss->clean_counter, wss->clean_period);
269 * wss.clean_entry. The table size, wss.num_entries,
272 entry = (atomic_inc_return(&wss->clean_entry) - 1)
273 & (wss->num_entries - 1);
276 bits = xchg(&wss->entries[entry], 0);
280 atomic_sub(weight, &wss->total_count);
287 static void wss_insert(struct rvt_wss *wss, void *address)
289 u32 page = ((unsigned long)address >> PAGE_SHIFT) & wss->pages_mask;
293 if (!test_and_set_bit(nr, &wss->entries[entry]))
294 atomic_inc(&wss->total_count);
296 wss_advance_clean_counter(wss);
302 static inline bool wss_exceeds_threshold(struct rvt_wss *wss)
304 return atomic_read(&wss->total_count) >= wss->threshold;
2872 struct rvt_wss *wss = rdi->wss;
2884 wss_insert(wss, sge->vaddr);
2886 wss_insert(wss, (sge->vaddr + PAGE_SIZE));
2888 cacheless_copy = wss_exceeds_threshold(wss);
2890 wss_advance_clean_counter(wss);