You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (241 commits) sched, trace: update trace_sched_wakeup() tracing/ftrace: don't trace on early stage of a secondary cpu boot, v3 Revert "x86: disable X86_PTRACE_BTS" ring-buffer: prevent false positive warning ring-buffer: fix dangling commit race ftrace: enable format arguments checking x86, bts: memory accounting x86, bts: add fork and exit handling ftrace: introduce tracing_reset_online_cpus() helper tracing: fix warnings in kernel/trace/trace_sched_switch.c tracing: fix warning in kernel/trace/trace.c tracing/ring-buffer: remove unused ring_buffer size trace: fix task state printout ftrace: add not to regex on filtering functions trace: better use of stack_trace_enabled for boot up code trace: add a way to enable or disable the stack tracer x86: entry_64 - introduce FTRACE_ frame macro v2 tracing/ftrace: add the printk-msg-only option tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp() x86, bts: correctly report invalid bts records ... Fixed up trivial conflict in scripts/recordmcount.pl due to SH bits being already partly merged by the SH merge.
This commit is contained in:
+4
-1
@@ -14,6 +14,7 @@
|
||||
#include <linux/hash.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/blktrace_api.h>
|
||||
#include <trace/block.h>
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
#define POOL_SIZE 64
|
||||
@@ -21,6 +22,8 @@
|
||||
|
||||
static mempool_t *page_pool, *isa_page_pool;
|
||||
|
||||
DEFINE_TRACE(block_bio_bounce);
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
static __init int init_emergency_pool(void)
|
||||
{
|
||||
@@ -222,7 +225,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
|
||||
if (!bio)
|
||||
return;
|
||||
|
||||
blk_add_trace_bio(q, *bio_orig, BLK_TA_BOUNCE);
|
||||
trace_block_bio_bounce(q, *bio_orig);
|
||||
|
||||
/*
|
||||
* at least one page was bounced, fill in possible non-highmem
|
||||
|
||||
+45
@@ -667,3 +667,48 @@ void user_shm_unlock(size_t size, struct user_struct *user)
|
||||
spin_unlock(&shmlock_user_lock);
|
||||
free_uid(user);
|
||||
}
|
||||
|
||||
void *alloc_locked_buffer(size_t size)
|
||||
{
|
||||
unsigned long rlim, vm, pgsz;
|
||||
void *buffer = NULL;
|
||||
|
||||
pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT;
|
||||
|
||||
down_write(¤t->mm->mmap_sem);
|
||||
|
||||
rlim = current->signal->rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT;
|
||||
vm = current->mm->total_vm + pgsz;
|
||||
if (rlim < vm)
|
||||
goto out;
|
||||
|
||||
rlim = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT;
|
||||
vm = current->mm->locked_vm + pgsz;
|
||||
if (rlim < vm)
|
||||
goto out;
|
||||
|
||||
buffer = kzalloc(size, GFP_KERNEL);
|
||||
if (!buffer)
|
||||
goto out;
|
||||
|
||||
current->mm->total_vm += pgsz;
|
||||
current->mm->locked_vm += pgsz;
|
||||
|
||||
out:
|
||||
up_write(¤t->mm->mmap_sem);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void free_locked_buffer(void *buffer, size_t size)
|
||||
{
|
||||
unsigned long pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT;
|
||||
|
||||
down_write(¤t->mm->mmap_sem);
|
||||
|
||||
current->mm->total_vm -= pgsz;
|
||||
current->mm->locked_vm -= pgsz;
|
||||
|
||||
up_write(¤t->mm->mmap_sem);
|
||||
|
||||
kfree(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user