Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754206AbcKIXfB (ORCPT ); Wed, 9 Nov 2016 18:35:01 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:46511 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbcKIXfA (ORCPT ); Wed, 9 Nov 2016 18:35:00 -0500 MIME-Version: 1.0 In-Reply-To: References: From: "Jason A. Donenfeld" Date: Thu, 10 Nov 2016 00:34:54 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Proposal: HAVE_SEPARATE_IRQ_STACK? To: Thomas Gleixner Cc: LKML , linux-mips@linux-mips.org, linux-mm@kvack.org, WireGuard mailing list , k@vodka.home.kg Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1023 Lines: 24 Hey Thomas, On Wed, Nov 9, 2016 at 10:40 PM, Thomas Gleixner wrote: > That preempt_disable() prevents merily preemption as the name says, but it > wont prevent softirq handlers from running on return from interrupt. So > what's the point? Oh, interesting. Okay, then in that case the proposed define wouldn't be useful for my purposes. What clever tricks do I have at my disposal, then? >> If not, do you have a better solution for me (which doesn't >> involve using kmalloc or choosing a different crypto primitive)? > > What's wrong with using kmalloc? It's cumbersome and potentially slow. This is crypto code, where speed matters a lot. Avoiding allocations is usually the lowest hanging fruit among optimizations. To give you some idea, here's a somewhat horrible solution using kmalloc I hacked together: [1]. I'm not to happy with what it looks like, code-wise, and there's around a 16% slowdown, which isn't nice either. [1] https://git.zx2c4.com/WireGuard/commit/?h=jd/curve25519-kmalloc