From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AFC2C468BC for ; Mon, 10 Jun 2019 05:06:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DD3120861 for ; Mon, 10 Jun 2019 05:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387512AbfFJFGZ (ORCPT ); Mon, 10 Jun 2019 01:06:25 -0400 Received: from foss.arm.com ([217.140.110.172]:36280 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387402AbfFJFGY (ORCPT ); Mon, 10 Jun 2019 01:06:24 -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 A00A9337; Sun, 9 Jun 2019 22:06:23 -0700 (PDT) Received: from [10.162.42.131] (p8cg001049571a15.blr.arm.com [10.162.42.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D10043F557; Sun, 9 Jun 2019 22:06:13 -0700 (PDT) Subject: Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() To: Dave Hansen , Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Andrew Morton , Michal Hocko , Mark Rutland , Christophe Leroy , Stephen Rothwell , Andrey Konovalov , Michael Ellerman , Paul Mackerras , Russell King , Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , "David S. Miller" , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Andy Lutomirski , Dave Hansen , Vineet Gupta , linux-snps-arc@lists.infradead.org, James Hogan , linux-mips@vger.kernel.org, Ralf Baechle , Paul Burton References: <1559903655-5609-1-git-send-email-anshuman.khandual@arm.com> <20190607201202.GA32656@bombadil.infradead.org> <33c6a1cd-5c07-e623-28e5-f31f6fe30394@intel.com> From: Anshuman Khandual Message-ID: <62aa0369-9542-17bc-034b-8445664c7c10@arm.com> Date: Mon, 10 Jun 2019 10:36:32 +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: <33c6a1cd-5c07-e623-28e5-f31f6fe30394@intel.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 10:27 AM, Dave Hansen wrote: > On 6/9/19 9:34 PM, Anshuman Khandual wrote: >>> Do you really think this is easier to read? >>> >>> Why not just move the x86 version to include/linux/kprobes.h, and replace >>> the int with bool? >> Will just return bool directly without an additional variable here as suggested >> before. But for the conditional statement, I guess the proposed one here is more >> compact than the x86 one. > > FWIW, I don't think "compact" is generally a good goal for code. Being > readable is 100x more important than being compact and being un-compact > is only a problem when it hurts readability. > > For a function like the one in question, having the individual return > conditions clearly commented is way more important than saving 10 lines > of code. Fair enough. Will keep the existing code flow from x86.