Skip to content

Instantly share code, notes, and snippets.

View laijs's full-sized avatar

Lai Jiangshan laijs

  • AntGroup
  • Nanjing
View GitHub Profile
#define _GNU_SOURCE
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
void main(void) {
int pid = getpid();
char *cmd;
// asprintf(&cmd, "cat /proc/%d/maps", pid);
@laijs
laijs / test-lglock.c
Last active December 14, 2015 09:38
test lglock
#include <linux/module.h>
#include <linux/lglock.h>
#include <linux/percpu-rwlock.h>
#include <linux/sched.h>
DEFINE_STATIC_LGRWLOCK(test_lgrw);
DEFINE_STATIC_PERCPU_RWLOCK(test_percpu_rwlock);
static DEFINE_RWLOCK(test_rwlock);
#define TEST_COUNT 10000