Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Leonardo Bras <leonardo@xxxxxxxxxxxxx>, Christophe Leroy <christophe.leroy@xxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- Subject: Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault()
- From: Anshuman Khandual <anshuman.khandual@xxxxxxx>
- Date: Tue, 11 Jun 2019 10:44:00 +0530
- Cc: Mark Rutland <mark.rutland@xxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Matthew Wilcox <willy@xxxxxxxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, Russell King <linux@xxxxxxxxxxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>, Andrey Konovalov <andreyknvl@xxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Tony Luck <tony.luck@xxxxxxxxx>, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>
- In-reply-to: <8dd6168592437378ff4a7c204e0f2962d002b44f.camel@linux.ibm.com>
- References: <1559903655-5609-1-git-send-email-anshuman.khandual@arm.com> <ec764ff4-f68a-fce5-ac1e-a4664e1123c7@c-s.fr> <97e9c9b3-89c8-d378-4730-841a900e6800@arm.com> <8dd6168592437378ff4a7c204e0f2962d002b44f.camel@linux.ibm.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
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.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]