From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932070AbdBHQf6 (ORCPT ); Wed, 8 Feb 2017 11:35:58 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:54252 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752682AbdBHQfp (ORCPT ); Wed, 8 Feb 2017 11:35:45 -0500 Date: Wed, 8 Feb 2017 15:56:22 +0100 (CET) From: Thomas Gleixner To: Mel Gorman cc: Andrew Morton , Peter Zijlstra , Michal Hocko , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix In-Reply-To: <20170208143128.25ahymqlyspjcixu@techsingularity.net> Message-ID: References: <20170208143128.25ahymqlyspjcixu@techsingularity.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Feb 2017, Mel Gorman wrote: > preempt_enable_no_resched() was used based on review feedback that had no > strong objection at the time. It avoided introducing a preemption point > where one didn't exist before which was marginal at best. Actually local_irq_enable() _IS_ a preemption point, indirect but still: local_irq_disable() .... --> HW interrupt is raised .... local_irq_enable() handle_irq() set_need_resched() ret_from_irq() preempt() while with preempt_disable that looks like this: preempt_disable() .... --> HW interrupt is raised handle_irq() set_need_resched() ret_from_irq() .... preempt_enable() preempt() Now if you use preempt_enable_no_resched() then you miss the preemption and depending on the actual code path you might run something which takes ages without hitting a preemption point after that. It's not only a problem for RT. It's also in mainline a violation of the preemption mechanism. Thanks, tglx