Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3137310pxk; Tue, 15 Sep 2020 10:58:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi/0eydRsXj0xADmKqqaMYB2UqrRyYtb4UREwGLg7ZJxH9Z+VMgLVDbdNF7TVX8qwbGTgU X-Received: by 2002:a17:906:46c9:: with SMTP id k9mr20885346ejs.38.1600192718276; Tue, 15 Sep 2020 10:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600192718; cv=none; d=google.com; s=arc-20160816; b=tpahUaxPSyCFxcyVpqBYX77wzMwiKC93CXcqK4aTR1wgSb1ejGikBEIrrdIg7eEcIH 4Ze1ORptCCNPJ1/SInC8IszGrs1QjAPnE3PYdrImuuRjKqGHz4/WaKXl/KTUhL4p81SD wcK0Z3Se9MTJfHmCdQovxQzoLhmEgIMEDAtW11Mc8WYRHqgGKKMpjG+VlbHYk8+w08MG /fQztu/7uAhOOlndRZoAC5SmXnYmAqTcAuLyijpeDc94Unx3Dj8gxGVW6ZqRbpJ+q6lb 7vYrySF0J5hNPxunNNQqYqGsA+WLvjkaVFyeKYmsn5uWvkPYWrP/zSssceR/BjICt2b+ tH/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0nYcbfWZAApGs9MKHeuMMDYKDYJP/KjXcIMY7yTiRjk=; b=uY5jCZNKEbDztofBUnFhN03qD83DRIvQ0eZD+kTmRo27PM1spbryg3yEQAzoQVH3SF DmZIKYkcsOwXlArNZuugUOKdmQ0WrQcTSpwIz0kgyf138K2YphzrcdPpfXptd+gadSSU cBr6AJiJkEw0DLrVMj40Tbk3Q1tFdUAFjYORfa5yx2+xS99fy+SSJOUtOtxgwax3UdHU glxuy3C5sfcsem4VHtinCBZQppR3GXWAPz8ZolfGhG73N6b5MJb/rVsv9u/4FmhpLKXc 5bW1MRaIAbjndtkmCDaQCZ5j4E5eFdYLM3Kuxmvi6ot2HgN6KRKASYwAdu8MdQPvT8QC uUjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="hFeX95/T"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si10195641ejr.168.2020.09.15.10.58.15; Tue, 15 Sep 2020 10:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="hFeX95/T"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727970AbgIOR5E (ORCPT + 99 others); Tue, 15 Sep 2020 13:57:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727903AbgIORlM (ORCPT ); Tue, 15 Sep 2020 13:41:12 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF2DC06174A for ; Tue, 15 Sep 2020 10:41:11 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id x77so4046420lfa.0 for ; Tue, 15 Sep 2020 10:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0nYcbfWZAApGs9MKHeuMMDYKDYJP/KjXcIMY7yTiRjk=; b=hFeX95/TT9jtwZAL/DonKpuMHGRk/7SCmZequDM1VaRmacKDQZY4lc39NgOcx0VujL ul3l8yb5Ugprhwk3dogs1JqCkfr90spWSTqKGkSLsF9w3lXrIygeRUDRxh1yw1QSoeb3 vUCYW8AmUQyz6zbxknLrsvz9nPCTdNe9Dcd+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0nYcbfWZAApGs9MKHeuMMDYKDYJP/KjXcIMY7yTiRjk=; b=QlBZag9OUdnzHopCd4YjVglgMcQBgDIsub87PVB2Re9/XHmT9yzYQpg+k25p6IYo0F BjhbWPyekXF9NaDWVgwJqbZqqcrQ2QjojtrD/42NVaHg5loKpW1j17kD/ks3ESg0DvPk bnhRl7Rj+HdBcwwjSwk2jCUPBK91VPC42e+P28qc2AWtsKefR1Qm7dIU8CIYEFH3QwaU /IjpCIEnq7Bm198xJn0xVqvekRYYYji0ttA2I2c3ZdfZaSVGJwdpPNw3YfRUsaVDd34/ GdbOxgXWL009RCj1kwwE7XTcl550wsrtJ0ZAx0KVfSu9igjrbi2KqyMjHd6P9RIzE7Ni eHqw== X-Gm-Message-State: AOAM532IZGFQVbA6RYz8ni0EB4v71PJqyEtojjFX2O3Z+JNu83i+Me1f WoLV7ffdlQ60eiWuMeG/0LC9bnYjUwgj2w== X-Received: by 2002:ac2:491e:: with SMTP id n30mr5966762lfi.395.1600191669479; Tue, 15 Sep 2020 10:41:09 -0700 (PDT) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id x5sm4068196lfd.119.2020.09.15.10.41.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Sep 2020 10:41:09 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id d15so3970102lfq.11 for ; Tue, 15 Sep 2020 10:41:09 -0700 (PDT) X-Received: by 2002:ac2:5594:: with SMTP id v20mr6798322lfg.344.1600191336149; Tue, 15 Sep 2020 10:35:36 -0700 (PDT) MIME-Version: 1.0 References: <20200914204209.256266093@linutronix.de> <871rj4owfn.fsf@nanos.tec.linutronix.de> <87bli75t7v.fsf@nanos.tec.linutronix.de> In-Reply-To: <87bli75t7v.fsf@nanos.tec.linutronix.de> From: Linus Torvalds Date: Tue, 15 Sep 2020 10:35:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 00/13] preempt: Make preempt count unconditional To: Thomas Gleixner Cc: Ard Biesheuvel , Herbert Xu , LKML , linux-arch , Sebastian Andrzej Siewior , Valentin Schneider , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um , Brian Cain , linux-hexagon@vger.kernel.org, Geert Uytterhoeven , linux-m68k , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Andrew Morton , Linux-MM , Ingo Molnar , Russell King , Linux ARM , Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gfx , dri-devel , "Paul E. McKenney" , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Shuah Khan , rcu@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 1:39 AM Thomas Gleixner wrote: > > OTOH, having a working 'preemptible()' or maybe better named > 'can_schedule()' check makes tons of sense to make decisions about > allocation modes or other things. No. I think that those kinds of decisions about actual behavior are always simply fundamentally wrong. Note that this is very different from having warnings about invalid use. THAT is correct. It may not warn in all configurations, but that doesn't matter: what matters is that it warns in common enough configurations that developers will catch it. So having a warning in "might_sleep()" that doesn't always trigger, because you have a limited configuration that can't even detect the situation, that's fine and dandy and intentional. But having code like if (can_schedule()) .. do something different .. is fundamentally complete and utter garbage. It's one thing if you test for "am I in hardware interrupt context". Those tests aren't great either, but at least they make sense. But a driver - or some library routine - making a difference based on some nebulous "can I schedule" is fundamentally and basically WRONG. If some code changes behavior, it needs to be explicit to the *caller* of that code. So this is why GFP_ATOMIC is fine, but "if (!can_schedule()) do_something_atomic()" is pure shite. And I am not IN THE LEAST interested in trying to help people doing pure shite. We need to fix them. Like the crypto code is getting fixed. Linus