cec.c (818b26588994d9d95743fca0a427f08ec6c1c41d) cec.c (b011a57e41ccbd402ecdcb53514ba76b898ec22e)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2017-2019 Borislav Petkov, SUSE Labs.
4 */
5#include <linux/mm.h>
6#include <linux/gfp.h>
7#include <linux/ras.h>
8#include <linux/kernel.h>

--- 24 unchanged lines hidden (view full) ---

33 * inserted/touched elements have higher 12-bit counts (which we've manufactured)
34 * and thus iterating over the array initially won't kick out those elements
35 * which were inserted last.
36 *
37 * Spring cleaning is what we do when we reach a certain number CLEAN_ELEMS of
38 * elements entered into the array, during which, we're decaying all elements.
39 * If, after decay, an element gets inserted again, its generation is set to 11b
40 * to make sure it has higher numerical count than other, older elements and
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2017-2019 Borislav Petkov, SUSE Labs.
4 */
5#include <linux/mm.h>
6#include <linux/gfp.h>
7#include <linux/ras.h>
8#include <linux/kernel.h>

--- 24 unchanged lines hidden (view full) ---

33 * inserted/touched elements have higher 12-bit counts (which we've manufactured)
34 * and thus iterating over the array initially won't kick out those elements
35 * which were inserted last.
36 *
37 * Spring cleaning is what we do when we reach a certain number CLEAN_ELEMS of
38 * elements entered into the array, during which, we're decaying all elements.
39 * If, after decay, an element gets inserted again, its generation is set to 11b
40 * to make sure it has higher numerical count than other, older elements and
41 * thus emulate an an LRU-like behavior when deleting elements to free up space
41 * thus emulate an LRU-like behavior when deleting elements to free up space
42 * in the page.
43 *
44 * When an element reaches it's max count of action_threshold, we try to poison
45 * it by assuming that errors triggered action_threshold times in a single page
46 * are excessive and that page shouldn't be used anymore. action_threshold is
47 * initialized to COUNT_MASK which is the maximum.
48 *
49 * That error event entry causes cec_add_elem() to return !0 value and thus

--- 545 unchanged lines hidden ---
42 * in the page.
43 *
44 * When an element reaches it's max count of action_threshold, we try to poison
45 * it by assuming that errors triggered action_threshold times in a single page
46 * are excessive and that page shouldn't be used anymore. action_threshold is
47 * initialized to COUNT_MASK which is the maximum.
48 *
49 * That error event entry causes cec_add_elem() to return !0 value and thus

--- 545 unchanged lines hidden ---