mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-02 06:29:47 +00:00
590.44.01
This commit is contained in:
@@ -40,10 +40,6 @@
|
||||
#include "nv-linux.h"
|
||||
|
||||
#include <linux/log2.h>
|
||||
#if defined(NV_PRIO_TREE_PRESENT)
|
||||
#include <linux/prio_tree.h>
|
||||
#endif
|
||||
|
||||
#include <linux/jhash.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include <linux/rbtree.h>
|
||||
@@ -117,21 +113,14 @@
|
||||
#define NVIDIA_UVM_PRETTY_PRINTING_PREFIX "nvidia-uvm: "
|
||||
#define pr_fmt(fmt) NVIDIA_UVM_PRETTY_PRINTING_PREFIX fmt
|
||||
|
||||
// Dummy printing function that maintains syntax and format specifier checking
|
||||
// but doesn't print anything and doesn't evaluate the print parameters. This is
|
||||
// roughly equivalent to the kernel's no_printk function. We use this instead
|
||||
// because:
|
||||
// 1) no_printk was not available until 2.6.36
|
||||
// 2) Until 4.5 no_printk was implemented as a static function, meaning its
|
||||
// parameters were always evaluated
|
||||
#define UVM_NO_PRINT(fmt, ...) \
|
||||
do { \
|
||||
if (0) \
|
||||
printk(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define NV_UVM_GFP_FLAGS (GFP_KERNEL | __GFP_NOMEMALLOC)
|
||||
|
||||
#if defined(NV_GET_DEV_PAGEMAP_HAS_PGMAP_ARG)
|
||||
#define NV_GET_DEV_PAGEMAP(pfn) get_dev_pagemap(pfn, NULL)
|
||||
#else
|
||||
#define NV_GET_DEV_PAGEMAP get_dev_pagemap
|
||||
#endif
|
||||
|
||||
/* Return a nanosecond-precise value */
|
||||
static inline NvU64 NV_GETTIME(void)
|
||||
{
|
||||
@@ -141,25 +130,6 @@ static inline NvU64 NV_GETTIME(void)
|
||||
return (NvU64) timespec64_to_ns(&tm);
|
||||
}
|
||||
|
||||
// atomic_long_read_acquire and atomic_long_set_release were added in commit
|
||||
// b5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb ("locking/atomics: Switch to
|
||||
// generated atomic-long") in v5.1 (2019-05-05).
|
||||
// TODO: Bug 3849079: We always use these definitions on newer kernels.
|
||||
#define atomic_long_read_acquire uvm_atomic_long_read_acquire
|
||||
static inline long uvm_atomic_long_read_acquire(atomic_long_t *p)
|
||||
{
|
||||
long val = atomic_long_read(p);
|
||||
smp_mb();
|
||||
return val;
|
||||
}
|
||||
|
||||
#define atomic_long_set_release uvm_atomic_long_set_release
|
||||
static inline void uvm_atomic_long_set_release(atomic_long_t *p, long v)
|
||||
{
|
||||
smp_mb();
|
||||
atomic_long_set(p, v);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct mem_cgroup *new_memcg;
|
||||
|
||||
Reference in New Issue
Block a user