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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 80502C433E2 for ; Mon, 14 Sep 2020 22:30:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 101472065E for ; Mon, 14 Sep 2020 22:30:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="XFttBOpQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 101472065E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3055A6E7D4; Mon, 14 Sep 2020 22:30:50 +0000 (UTC) Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F5786E7D4 for ; Mon, 14 Sep 2020 22:30:49 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id z19so994362lfr.4 for ; Mon, 14 Sep 2020 15:30:49 -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=FYq5Ck3jxQlGA/9U/OgNyRBwFyvhqjGeOq2xChwQGbM=; b=XFttBOpQLvqvIRVeSi6uJbTlvU6SlD5mRsF0dJOTawed/ahybFXu96kFFWmQERfAs5 uWk/oLz9DrNGHszMiHMxoNqcLliSwLYwqi8cuttKuqm5YKsnPsoT05HyVh7UvUs3bSkf Wa6vYuwCrOJ+5ggzCPNzgdilcNNnHeeOAvJeA= 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=FYq5Ck3jxQlGA/9U/OgNyRBwFyvhqjGeOq2xChwQGbM=; b=ikQ8a6Qgdhx0wzqI/bt/yBWi3DL4XN5SoBjRVhiuFpf9t9Bf8Kwcdaf8OTfI3tXyax SadMad2SWTrLjC6f+nCwiOD/Y4HVEJFLQZCb3NZbIk1dJGaj65BNNXZxml2A2yEEdATq y9+zEJrHpbcL/wC7jvIPsjHLe6dql6X5JRGPWA7Zw0E6LJl6QtHcKUcVTX1rJKZAghrA XludZ8PIjlThqQ7x/LT+zW5ffHB9HbZRcXpiJaDpujcEK7gQDVNMEVCxQIoi98sS/Fwe /i1sWHBHox+CwmyKQhI3DfjiX5FNJqHLhe178ULeJ44knq1Bu6xi7zDrqWNSBRZzttsz EnGA== X-Gm-Message-State: AOAM531ksI1EBGs2K0ktNd0MwOe1Rj59A3wIKIbQapqUQuxcY37/9XHr D7ks+ubHUK5NlfYOp212T87k00u+e24iJA== X-Google-Smtp-Source: ABdhPJxNS8srRRXOH+ENINcGwLojTlzSxKSu+Ic+vG8iNedDr8nuSIYTnIOCtST9odZ2WlkXspKO1Q== X-Received: by 2002:a19:610a:: with SMTP id v10mr5388501lfb.414.1600122647528; Mon, 14 Sep 2020 15:30:47 -0700 (PDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id d28sm3594505lfn.277.2020.09.14.15.30.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Sep 2020 15:30:47 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id w3so1064404ljo.5 for ; Mon, 14 Sep 2020 15:30:47 -0700 (PDT) X-Received: by 2002:a2e:91cd:: with SMTP id u13mr5174538ljg.421.1600122308748; Mon, 14 Sep 2020 15:25:08 -0700 (PDT) MIME-Version: 1.0 References: <20200914204209.256266093@linutronix.de> <871rj4owfn.fsf@nanos.tec.linutronix.de> In-Reply-To: <871rj4owfn.fsf@nanos.tec.linutronix.de> From: Linus Torvalds Date: Mon, 14 Sep 2020 15:24:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 00/13] preempt: Make preempt count unconditional To: Thomas Gleixner , Ard Biesheuvel , Herbert Xu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , Peter Zijlstra , Sebastian Andrzej Siewior , Lai Jiangshan , dri-devel , Ben Segall , Linux-MM , "open list:KERNEL SELFTEST FRAMEWORK" , linux-hexagon@vger.kernel.org, Will Deacon , Ingo Molnar , Anton Ivanov , linux-arch , Vincent Guittot , Brian Cain , Richard Weinberger , Russell King , David Airlie , Ingo Molnar , Geert Uytterhoeven , Mel Gorman , intel-gfx , Matt Turner , Valentin Schneider , linux-xtensa@linux-xtensa.org, Shuah Khan , "Paul E. McKenney" , Jeff Dike , linux-um , Josh Triplett , Steven Rostedt , rcu@vger.kernel.org, linux-m68k , Ivan Kokshaysky , Rodrigo Vivi , Dietmar Eggemann , Linux ARM , Richard Henderson , Chris Zankel , Max Filippov , LKML , alpha , Mathieu Desnoyers , Andrew Morton , Daniel Bristot de Oliveira Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Sep 14, 2020 at 2:55 PM Thomas Gleixner wrote: > > Yes it does generate better code, but I tried hard to spot a difference > in various metrics exposed by perf. It's all in the noise and I only > can spot a difference when the actual preemption check after the > decrement I'm somewhat more worried about the small-device case. That said, the diffstat certainly has its very clear charm, and I do agree that it makes things simpler. I'm just not convinced people should ever EVER do things like that "if (preemptible())" garbage. It sounds like somebody is doing seriously bad things. The chacha20poly1305 code does look fundamentally broken. But no, the fix is not to make "preemptible" work with spinlocks, the fix is to not *do* that kind of broken things. Those things would be broken even if you changed the semantics of preemptible. There's no way that it's valid to say "use this debug flag to decide if we should do atomic allocations or not". It smells like "I got a debug failure, so I'm papering it over by checking the thing the debug code checks for". The debug check is to catch the obvious bad cases. It's not the _only_ bad cases, so copying the debug check test is just completely wrong. Ard and Herbert added to participants: see chacha20poly1305_crypt_sg_inplace(), which does flags = SG_MITER_TO_SG; if (!preemptible()) flags |= SG_MITER_ATOMIC; introduced in commit d95312a3ccc0 ("crypto: lib/chacha20poly1305 - reimplement crypt_from_sg() routine"). You *fundamentally* cannot do that. Seriously. It's completely wrong. Pick one or the other, or have the caller *tell* you what the context is. Linus _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel