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=-0.6 required=3.0 tests=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 3CC7CC2D0E5 for ; Wed, 25 Mar 2020 18:09:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 059AC206F8 for ; Wed, 25 Mar 2020 18:09:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WadpRrgQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 059AC206F8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8ABFD6B00C6; Wed, 25 Mar 2020 14:09:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 836526B00C7; Wed, 25 Mar 2020 14:09:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FD8A6B00C8; Wed, 25 Mar 2020 14:09:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0123.hostedemail.com [216.40.44.123]) by kanga.kvack.org (Postfix) with ESMTP id 52ECE6B00C6 for ; Wed, 25 Mar 2020 14:09:51 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2F524181F86CE for ; Wed, 25 Mar 2020 18:09:51 +0000 (UTC) X-FDA: 76634672982.03.crook37_7316e9991282c X-HE-Tag: crook37_7316e9991282c X-Filterd-Recvd-Size: 5012 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 18:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=J8VTavwt8olZRjZOqw1yoTEyzCgM56KAVKU+JPN4Gw0=; b=WadpRrgQXfv/YLTmbKhkFAMe3u 5K+AV5op5sCu+iZ/ECkLKoAJpWzh5K6T42ItJks8lA63toANZi30g8WOPl6yrSBMPOeJfrMo447Tw QQjR0/jaV/rRUN49ScljGqT9S854FMQlsSdfntWcfWh57b8pbdr+uczgZJ9kyeiRotmqNemjZMLRe b/ece3oKCJAMeBJoBrVzBeDVSk3fmNck2i2roDqb4OsQ1vHOScELt5y3yLivl+3cUnc9SG2eC+xzH mortyRhT1LyKP6xJ1V6x76jnsxLbX7z0PUNvh3pSM2Dufu/829W1ojP7NPdgljkjNeI95F0PKzh7s fiAi+zmg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHATF-0006fi-GM; Wed, 25 Mar 2020 18:09:41 +0000 Date: Wed, 25 Mar 2020 11:09:41 -0700 From: Matthew Wilcox To: Alexander Potapenko Cc: Michal Hocko , Vegard Nossum , Andrew Morton , Dmitry Vyukov , Marco Elver , Andrey Konovalov , Linux Memory Management List , Al Viro , Andreas Dilger , Andrey Ryabinin , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Christoph Hellwig , Christoph Hellwig , "Darrick J. Wong" , David Miller , Dmitry Torokhov , Eric Biggers , Eric Dumazet , Eric Van Hensbergen , Greg Kroah-Hartman , Harry Wentland , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jason Wang , Jens Axboe , Marek Szyprowski , Mark Rutland , "Martin K . Petersen" , Martin Schwidefsky , "Michael S. Tsirkin" , Michal Simek , Petr Mladek , Qian Cai , Randy Dunlap , Robin Murphy , Sergey Senozhatsky , Steven Rostedt , Takashi Iwai , Theodore Ts'o , Thomas Gleixner , Vasily Gorbik , Wolfram Sang Subject: Re: [PATCH v5 03/38] kmsan: gfp: introduce __GFP_NO_KMSAN_SHADOW Message-ID: <20200325180941.GD22483@bombadil.infradead.org> References: <20200325161249.55095-1-glider@google.com> <20200325161249.55095-4-glider@google.com> <20200325161952.GF19542@dhcp22.suse.cz> <20200325174916.GC22483@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 25, 2020 at 07:03:32PM +0100, Alexander Potapenko wrote: > > I would suggest using bits in the section labelled: > > > > /* Unserialized, strictly 'current' */ > > The main problem is that |current| is unavailable in the interrupt > context, so we'll also need to: > - disable interrupts when preparing for a KMSAN internal memory > allocation - sounds costly, huh? > - store the context flag in a per-cpu variable in the case |current| > is unavailable. It's not /unavailable/ ... it's whatever task happens to be running at the time the interrupt is triggered. You can borrow its task_struct. You'll have to save off the current value of the flag before setting it, just like memalloc_nofs_save() does. But this does rather call into question whether Michal's advice to use task_struct is good advice to begin with. For memalloc_nofs/noio, it works well this way because allocations in interrupt context are inherently at a more restrictive context than task level. It's not clear to me what this kmsan GFP flag is being used for, and whether allocations that happen in interrupt context should inherit the kmsan setting. I will have to read these patches more carefully to determine that; I was really just responding to the "where can I find some free bits" part of the question.