Lines Matching refs:wss

105 	struct rvt_wss *wss = rdi->wss;
107 if (!wss)
111 kfree(wss->entries);
112 wss->entries = NULL;
113 kfree(rdi->wss);
114 rdi->wss = NULL;
118 * rvt_wss_init - Init wss data structures
131 struct rvt_wss *wss;
135 rdi->wss = NULL;
139 rdi->wss = kzalloc_node(sizeof(*rdi->wss), GFP_KERNEL, node);
140 if (!rdi->wss)
142 wss = rdi->wss;
166 wss->pages_mask = table_bits - 1;
167 wss->num_entries = table_bits / BITS_PER_LONG;
169 wss->threshold = (llc_bits * wss_threshold) / 100;
170 if (wss->threshold == 0)
171 wss->threshold = 1;
173 wss->clean_period = wss_clean_period;
174 atomic_set(&wss->clean_counter, wss_clean_period);
176 wss->entries = kcalloc_node(wss->num_entries, sizeof(*wss->entries),
178 if (!wss->entries) {
201 static void wss_advance_clean_counter(struct rvt_wss *wss)
208 if (atomic_dec_and_test(&wss->clean_counter)) {
222 atomic_set(&wss->clean_counter, wss->clean_period);
227 * wss.clean_entry. The table size, wss.num_entries,
230 entry = (atomic_inc_return(&wss->clean_entry) - 1)
231 & (wss->num_entries - 1);
234 bits = xchg(&wss->entries[entry], 0);
238 atomic_sub(weight, &wss->total_count);
245 static void wss_insert(struct rvt_wss *wss, void *address)
247 u32 page = ((unsigned long)address >> PAGE_SHIFT) & wss->pages_mask;
251 if (!test_and_set_bit(nr, &wss->entries[entry]))
252 atomic_inc(&wss->total_count);
254 wss_advance_clean_counter(wss);
260 static inline bool wss_exceeds_threshold(struct rvt_wss *wss)
262 return atomic_read(&wss->total_count) >= wss->threshold;
2821 struct rvt_wss *wss = rdi->wss;
2833 wss_insert(wss, sge->vaddr);
2835 wss_insert(wss, (sge->vaddr + PAGE_SIZE));
2837 cacheless_copy = wss_exceeds_threshold(wss);
2839 wss_advance_clean_counter(wss);