Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3986308ybi; Mon, 10 Jun 2019 22:14:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG8US4oWZ8POYEBr3Taz2sujxkUbO8Prx2E3oMjFvNS14JQnAFCyJ+kPzeQ3GJAHKat7Cd X-Received: by 2002:a17:902:70cb:: with SMTP id l11mr13162036plt.343.1560230050737; Mon, 10 Jun 2019 22:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560230050; cv=none; d=google.com; s=arc-20160816; b=r35Di6GrBZBod4sg8yj9g/IDkhTAIvHm+eAQCOOy/UAqaFPNb0nk8yXKXaE/PEx2es 2a/2JcsYEMXD0cfv+h96VFAElwI1SAA+rGq7PVyyTU5b9kOSh8SpWbnUXZZHCH2rJzvn B+93l6Ynp1RND/9MWXw3sxyWjvsPxbTDhhTgVvtopO4+uCPRR4MwHxU2gLHyDVo4hgHD 5qQ7i/yz1UIIbXSE9W1CPcysTXtsXdJprQAivs8HAMNzgwdEqIyEiQVasqd7VqvgmmQH qWRW/XU596Q2t5vYV1GOgOoV8ZaLl/kLedvyJ4gErr5S1tZBICflSfqvOpe8Ng4eaTlA ZeGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=DYCngMJLOK/2cJ+86BjE3TjH5m/AAcN6WZ8gmMI5TH8=; b=HFchunKrctJnpcZtLzX9gQZ8acC8S+nx6bJVK3BwbIcNc3cAT/sLMwvpClZJPOlPwY uS0us7pth8UpWE1+ve5qG1R7yBySLkFASmrznIJ4OglneqBaFdhST/cVddjYueiPecOw XS48wSICu0moyyZCOa4ZF2BuZWVw/HKfiUk8UMM6ffIGvbEEiqgdKBIsQXc7hFBixq0R AxeJ1aQQKURfIXTmhrCz7Gv2rB8/NJ8rI8EwLco5cNM6NtNyvoX3708TfqiL0rSiyOT6 Bxj/y0cT2nCoYwoe8ylISQBNKJ4lRS0WkaA1FEgpZQquDayB3CrIj6ySDcmQ2zV9A0Qs gESw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e69si2401266pgc.154.2019.06.10.22.13.55; Mon, 10 Jun 2019 22:14:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391103AbfFKFNv (ORCPT + 99 others); Tue, 11 Jun 2019 01:13:51 -0400 Received: from foss.arm.com ([217.140.110.172]:52938 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390539AbfFKFNv (ORCPT ); Tue, 11 Jun 2019 01:13:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E9DC9344; Mon, 10 Jun 2019 22:13:49 -0700 (PDT) Received: from [10.162.43.135] (p8cg001049571a15.blr.arm.com [10.162.43.135]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F2A743F73C; Mon, 10 Jun 2019 22:13:41 -0700 (PDT) Subject: Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() To: Leonardo Bras , Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mark Rutland , Michal Hocko , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , Heiko Carstens , Paul Mackerras , Matthew Wilcox , sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, Yoshinori Sato , x86@kernel.org, Russell King , Will Deacon , Ingo Molnar , Fenghua Yu , Stephen Rothwell , Andrey Konovalov , Andy Lutomirski , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Tony Luck , Martin Schwidefsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" References: <1559903655-5609-1-git-send-email-anshuman.khandual@arm.com> <97e9c9b3-89c8-d378-4730-841a900e6800@arm.com> <8dd6168592437378ff4a7c204e0f2962d002b44f.camel@linux.ibm.com> From: Anshuman Khandual Message-ID: <7b0a7afd-2776-0d95-19c5-3e15959744eb@arm.com> Date: Tue, 11 Jun 2019 10:44:00 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8dd6168592437378ff4a7c204e0f2962d002b44f.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/2019 08:57 PM, Leonardo Bras wrote: > On Mon, 2019-06-10 at 08:09 +0530, Anshuman Khandual wrote: >>>> + /* >>>> + * To be potentially processing a kprobe fault and to be allowed >>>> + * to call kprobe_running(), we have to be non-preemptible. >>>> + */ >>>> + if (kprobes_built_in() && !preemptible() && !user_mode(regs)) { >>>> + if (kprobe_running() && kprobe_fault_handler(regs, trap)) >>> >>> don't need an 'if A if B', can do 'if A && B' >> >> Which will make it a very lengthy condition check. > > Well, is there any problem line-breaking the if condition? > > if (A && B && C && > D && E ) > > Also, if it's used only to decide the return value, maybe would be fine > to do somethink like that: > > return (A && B && C && > D && E ); Got it. But as Dave and Matthew had pointed out earlier, the current x86 implementation has better readability. Hence will probably stick with it.