Received: by 10.213.65.68 with SMTP id h4csp268105imn; Fri, 16 Mar 2018 02:28:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELsNFFHcG9xWZjduypST/jPFvExnynWR80C1Du5FSFptzOAmsNNuIM03ugKENuTj8guFhwR/ X-Received: by 2002:a17:902:6082:: with SMTP id s2-v6mr1331235plj.307.1521192485245; Fri, 16 Mar 2018 02:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521192485; cv=none; d=google.com; s=arc-20160816; b=wiekB7HEFwmfEKYhl3u+dIblgEpPLlYBjCbRmXqsg933h0mn/YqhRBIVp3xU9QMJUh Wus7Lii88Yyy0WT4nNWvljUQmE28oZaq3fwqyxuwgtjQbVE65oI1htaTYvlXdFpZPB/V kZMjOUTaQiYaF3NKfpqhCTirEfK770pZMnuAop0xu3VrjauDXMrWnE/kH29/mlLUgNR2 JoCw9BovBWfDu5hSWnIYPHPq4Hm1u9pQbcWg8HGs4rsmEmN5K5CWU3S1dZSG1SYyS1jy uuzoORQdWpCO3d6Nr8bioYGpfXB2Sb551O0GSS7lJbP617cgG++5TVEaScxfXFr3gpU1 DMUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :references:cc:to:subject:from:arc-authentication-results; bh=P8XPhFrG1W2aZYHic2nMCIc//ASp6LBjgFyR6AFFHxo=; b=IGWxfRH7gL3e6ved7zs3fpISI1PbgRRNfds/RLXnp/pNjQNw2xquK0x+ZeBPhtj5b1 +YXCXrWOv5t+7SRvwg4fv9ZGWKi9A/e71rktNa7eeNdgRFDeNHt4Pukj9LpdzvDapP4n yiq3CTWIBN8kh2f0dejWH6hr/YRWdU1iaNDrP3mj6gbhYY4c9tScn37KH4k0FfaO/vPe JDnch6RO0WGP4D0URQs6ojYHCHVf2xeFwUsOVsGnVnBnRS3IV7C/mYThjtdhqDnSUhNo tIo7/TgHfzSMNylCe/AkKo0TQyeA+LdePdAVPw9Z77dLp+YGDBY52TEHyxMga5LA7JbH It6Q== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v85si4719740pgb.829.2018.03.16.02.27.51; Fri, 16 Mar 2018 02:28:05 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbeCPJ0u (ORCPT + 99 others); Fri, 16 Mar 2018 05:26:50 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37686 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751022AbeCPJ0s (ORCPT ); Fri, 16 Mar 2018 05:26:48 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2G9QAOr031399 for ; Fri, 16 Mar 2018 05:26:48 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gra1h2tgk-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 16 Mar 2018 05:26:48 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Mar 2018 09:26:45 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 16 Mar 2018 09:26:38 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2G9QbiZ51183830; Fri, 16 Mar 2018 09:26:37 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79438A4057; Fri, 16 Mar 2018 09:19:25 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 768F4A4051; Fri, 16 Mar 2018 09:19:16 +0000 (GMT) Received: from [9.79.219.128] (unknown [9.79.219.128]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 16 Mar 2018 09:19:16 +0000 (GMT) From: Ravi Bangoria Subject: Re: [PATCH 5/8] trace_uprobe: Support SDT markers having reference count (semaphore) To: Oleg Nesterov Cc: mhiramat@kernel.org, peterz@infradead.org, srikar@linux.vnet.ibm.com, acme@kernel.org, ananth@linux.vnet.ibm.com, akpm@linux-foundation.org, alexander.shishkin@linux.intel.com, alexis.berlemont@gmail.com, corbet@lwn.net, dan.j.williams@intel.com, gregkh@linuxfoundation.org, huawei.libin@huawei.com, hughd@google.com, jack@suse.cz, jglisse@redhat.com, jolsa@redhat.com, kan.liang@intel.com, kirill.shutemov@linux.intel.com, kjlx@templeofstupid.com, kstewart@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.com, milian.wolff@kdab.com, mingo@redhat.com, namhyung@kernel.org, naveen.n.rao@linux.vnet.ibm.com, pc@us.ibm.com, pombredanne@nexb.com, rostedt@goodmis.org, tglx@linutronix.de, tmricht@linux.vnet.ibm.com, willy@infradead.org, yao.jin@linux.intel.com, fengguang.wu@intel.com, Ravi Bangoria References: <20180313125603.19819-1-ravi.bangoria@linux.vnet.ibm.com> <20180313125603.19819-6-ravi.bangoria@linux.vnet.ibm.com> <20180315142120.GA19218@redhat.com> <20180315143044.GA19643@redhat.com> Date: Fri, 16 Mar 2018 14:58:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180315143044.GA19643@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18031609-0012-0000-0000-000005BFD826 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031609-0013-0000-0000-0000193BE594 Message-Id: <3b303a2d-35dd-9178-fc03-de9f2d588797@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-16_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803160115 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/15/2018 08:00 PM, Oleg Nesterov wrote: > On 03/15, Oleg Nesterov wrote: >>> +static struct vm_area_struct * >>> +sdt_find_vma(struct mm_struct *mm, struct trace_uprobe *tu) >>> +{ >>> + struct vm_area_struct *tmp; >>> + >>> + for (tmp = mm->mmap; tmp != NULL; tmp = tmp->vm_next) >>> + if (sdt_valid_vma(tu, tmp)) >>> + return tmp; >>> + >>> + return NULL; >> I can't understand the logic... Lets ignore sdt_valid_vma() for now. >> The caller has uprobe_map_info, why it can't simply do >> vma = find_vma(uprobe_map_info->vaddr)? and then check sdt_valid_vma(). > Note to mention that sdt_find_vma() can return NULL but the callers do > vma_offset_to_vaddr(vma) without any check. If the "mm" we are passing to sdt_find_vma() is returned by uprobe_build_map_info(ref_ctr_offset), sdt_find_vma() must _not_ return NULL. Thanks for the review, Ravi