Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4505204imm; Mon, 18 Jun 2018 16:36:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKItm3aurCBGwDX6lpKHVUKqfNyc37y6yVCev3qfKEVfwK5H502nfzadb2xFxbUkgAXYlXCm X-Received: by 2002:a62:1146:: with SMTP id z67-v6mr15407922pfi.135.1529364992687; Mon, 18 Jun 2018 16:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529364992; cv=none; d=google.com; s=arc-20160816; b=soxJudHFMtS1vryEpM5pqCZcJDLTHHbXu08EYsmrDbEHyZaI8TDk4AlZbaBsR1pVop SpS2LiKNbU7sVJST7iVz0dIZwByGA4cf6GMRHjuojLbWUE+E1gF8jXjuY1lBsh9Ro1V0 H2I4VU/S/TFU1OdLPb1tfcKnPA0AorLGGMbSBtsbeF0lxJeGizJwamNq/jVRnuRCKEFZ CskLtEra2T2U5BA48yjnG5XtjvisY3zcTh6cVavKrodCc4ParD2ITkKBRWnydtZdfc7O u0dH4Cg6YaUaU7GFMWkZZPY4fQbItw0VFLsvD3lP4YqLcwmL//gAyN3eUT+yJ0mxuOUg 9QVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=IDJMBd+8EcVwH6+ovvFQAjEVVw6Ivou8Gp8oHsz/vv4=; b=k0GTFMLmvjuSJZzMB3lIIK+gJOrKrgc+KzznJ4vo46UStkdzihIAyZCZrzMGu3Y3gi Y+y3TOMwAl1sbidCpgwu3pk3o1BA74u/4qmzQ7loCcalaTJdCzZeHE677NZBbm61+bhS 5LA4NmBQTtP40swpsu5JH/gc/+Ue9GEsZZyCzrmMMQVkRPTG4MRsDSmzorPv8cBXgQCP XS1wZyfvrJIaXyfhvP0aTnCCKqjmIhGFFKc6DhSe6+98t54rHAeXFpUDOdxPF7F4JgKp 5QJgVyk+cnERGV8MzfiPrWALf9s7xDQnIRria+/PjPVrVmneZJ9HpSXthaDAz29G9XUY WXOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y198-v6si15799015pfg.246.2018.06.18.16.36.19; Mon, 18 Jun 2018 16:36:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937051AbeFRXex (ORCPT + 99 others); Mon, 18 Jun 2018 19:34:53 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:35118 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937025AbeFRXep (ORCPT ); Mon, 18 Jun 2018 19:34:45 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R841e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0T2yMyYn_1529364870; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T2yMyYn_1529364870) by smtp.aliyun-inc.com(127.0.0.1); Tue, 19 Jun 2018 07:34:36 +0800 From: Yang Shi To: mhocko@kernel.org, willy@infradead.org, ldufour@linux.vnet.ibm.com, akpm@linux-foundation.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC v2 PATCH 1/2] uprobes: make vma_has_uprobes non-static Date: Tue, 19 Jun 2018 07:34:15 +0800 Message-Id: <1529364856-49589-2-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1529364856-49589-1-git-send-email-yang.shi@linux.alibaba.com> References: <1529364856-49589-1-git-send-email-yang.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vma_has_uprobes() will be used in the following patch to check if a vma could be unmapped with holding read mmap_sem, but it is static. So, make it non-static to use outside uprobe. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Yang Shi --- include/linux/uprobes.h | 7 +++++++ kernel/events/uprobes.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 0a294e9..7f1fb8c 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -149,6 +149,8 @@ struct uprobes_state { extern bool arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs); extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, void *src, unsigned long len); +extern bool vma_has_uprobes(struct vm_area_struct *vma, unsigned long start, + unsigned long end); #else /* !CONFIG_UPROBES */ struct uprobes_state { }; @@ -203,5 +205,10 @@ static inline void uprobe_copy_process(struct task_struct *t, unsigned long flag static inline void uprobe_clear_state(struct mm_struct *mm) { } +static inline bool vma_has_uprobes(struct vm_area_struct *vma, unsigned long, + unsigned long end) +{ + return false; +} #endif /* !CONFIG_UPROBES */ #endif /* _LINUX_UPROBES_H */ diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 1725b90..bd46b7a 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1095,7 +1095,7 @@ int uprobe_mmap(struct vm_area_struct *vma) return 0; } -static bool +bool vma_has_uprobes(struct vm_area_struct *vma, unsigned long start, unsigned long end) { loff_t min, max; -- 1.8.3.1