Revision 7d638093d4b0e9ef15bd78f38f11f126e773cc14 authored by Vladimir Davydov on 10 June 2015, 18:14:46 UTC, committed by Linus Torvalds on 10 June 2015, 23:43:43 UTC
When trimming memcg consumption excess (see memory.high), we call
try_to_free_mem_cgroup_pages without checking if we are allowed to sleep
in the current context, which can result in a deadlock.  Fix this.

Fixes: 241994ed8649 ("mm: memcontrol: default hierarchy interface for memory")
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 85bd839
Raw File
bpf_asm.c
/*
 * Minimal BPF assembler
 *
 * Instead of libpcap high-level filter expressions, it can be quite
 * useful to define filters in low-level BPF assembler (that is kept
 * close to Steven McCanne and Van Jacobson's original BPF paper).
 * In particular for BPF JIT implementors, JIT security auditors, or
 * just for defining BPF expressions that contain extensions which are
 * not supported by compilers.
 *
 * How to get into it:
 *
 * 1) read Documentation/networking/filter.txt
 * 2) Run `bpf_asm [-c] <filter-prog file>` to translate into binary
 *    blob that is loadable with xt_bpf, cls_bpf et al. Note: -c will
 *    pretty print a C-like construct.
 *
 * Copyright 2013 Daniel Borkmann <borkmann@redhat.com>
 * Licensed under the GNU General Public License, version 2.0 (GPLv2)
 */

#include <stdbool.h>
#include <stdio.h>
#include <string.h>

extern void bpf_asm_compile(FILE *fp, bool cstyle);

int main(int argc, char **argv)
{
	FILE *fp = stdin;
	bool cstyle = false;
	int i;

	for (i = 1; i < argc; i++) {
		if (!strncmp("-c", argv[i], 2)) {
			cstyle = true;
			continue;
		}

		fp = fopen(argv[i], "r");
		if (!fp) {
			fp = stdin;
			continue;
		}

		break;
	}

	bpf_asm_compile(fp, cstyle);

	return 0;
}
back to top