Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1557180pxb; Fri, 10 Sep 2021 08:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyps9MK3VWlh4k7W/SeiwvXBWAlFRHlzbU1EE1VYySRB+fEPSX3Ce1dbRFWnu5CM+hz6vpd X-Received: by 2002:a5d:8458:: with SMTP id w24mr7423957ior.168.1631287759398; Fri, 10 Sep 2021 08:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631287759; cv=none; d=google.com; s=arc-20160816; b=VFQd4MG3g07PghA2EMTZ2mlYvOEASXRBMAONCmiyyvInuA8uOBLY+vzvi+WE6EquMn pI9hN0NVTgYR4GxAByVddj6relL/S4fqI9rtMcOIHD1/6ITZzcqdqAy0SiyQHLKHza6c QONX8PAx/4j47MLARy+L//6DgeSAPIo8F18QFR4+tOsQlayl79JBvxRMSVG/dNjyGZ/0 C6Ne1NJwYmtP7oyt/4fYnjZMXE8+3Hlr4wYKZYiqy/bk0nRPkWpPuIAt9KzpJWQWab61 GVjJ8itFfaQPe6Kc6waeyCCxhxRLLoQrFd6MlfPTAqC4Di1+tNCjlIHadbPXGJoXlGlN Hobw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=EI3QVBpMpmvzHjzxfllWn6UuMbjPLIo79cBtSieAgwY=; b=u5Kh53Mr7tgSF/1eIFkGPrHr23b6AuDTvYanHAOByvArP5fgqrj4f2JLQKTftqljaK YEh9FJvNx9MV4So+RLPwPwDLI5wVdEHtwkQmrXqtyqYvZ0CnTLTwRjqBkL93anFwMxJd OfCrhCIQHAeb/nGfu1aJiT2MTpx4NlcpM9kprQmnkkYI5CAvIdd5xOY0stLORoz15CA2 yKVxqD75yEVSPtiBy22NLYKrmMGubuL9IgVN+leeldR6vB1UPYRn/PIBlu2PyTjCx0Lc gWFjEniaTay+hshJiC1eshn7FKeZm0kUqpjjnC1U1RHa3npL4cqa5BYSX23kqZwJD2YG sBCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ol31PPlD; dkim=neutral (no key) header.i=@linutronix.de header.b=CTBuqRuz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si5303678ioz.60.2021.09.10.08.29.06; Fri, 10 Sep 2021 08:29:19 -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=@linutronix.de header.s=2020 header.b=ol31PPlD; dkim=neutral (no key) header.i=@linutronix.de header.b=CTBuqRuz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234312AbhIJP3d (ORCPT + 99 others); Fri, 10 Sep 2021 11:29:33 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:39332 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234130AbhIJP3c (ORCPT ); Fri, 10 Sep 2021 11:29:32 -0400 Date: Fri, 10 Sep 2021 17:28:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1631287700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EI3QVBpMpmvzHjzxfllWn6UuMbjPLIo79cBtSieAgwY=; b=ol31PPlDXDfl+M5gSmepoP9EKuJUmJsp8JJkOV05HaEFdXil1HBYXUccnaSkldCpGVSMwv 2m8so64VziRj+v4bYNBow7z+MoMwEWytH2gwip8XuwRa7fQwlCfVqMmq3J8nvMmNnQfXUJ GB3bRwAAnQfl+NGZV4OBfnBzY7fwV8h1LVrHpJoFfOi9tk6AmvWKpBAVrV6wHJR62EB1oo 4VoBvHzrj5LUWih47DumUm3N/rsGGmaTG2MV4CCs1oOzg+h8ZFiBiJVqbJOektAnR6tzn1 XF1khQe5YB1upskf7gQ70gMZhsF5Cul6RtPus5Ob4bqbfRGiWn6fVKSF3NAeIA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1631287700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EI3QVBpMpmvzHjzxfllWn6UuMbjPLIo79cBtSieAgwY=; b=CTBuqRuz3Txo5V8Vb1FWxUyua1rQ2Bn2petDtwbDPd8lPf/aFLi22NPSg+P8fz5CeUVGde HuHq2ya8kCWcvZCA== From: Sebastian Andrzej Siewior To: Vlastimil Babka Cc: Shuah Khan , Marco Elver , Andrew Morton , Tejun Heo , Lai Jiangshan , Andrey Konovalov , Walter Wu , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Vijayanand Jitta , Vinayak Menon , "Gustavo A. R. Silva" , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Aleksandr Nogikh , Taras Madan , Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH 0/6] stackdepot, kasan, workqueue: Avoid expanding stackdepot slabs when holding raw_spin_lock Message-ID: <20210910152819.ir5b2yijkqly3o6l@linutronix.de> References: <20210907141307.1437816-1-elver@google.com> <69f98dbd-e754-c34a-72cf-a62c858bcd2f@linuxfoundation.org> <1b1569ac-1144-4f9c-6938-b9d79c6743de@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1b1569ac-1144-4f9c-6938-b9d79c6743de@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-09-10 12:50:51 [+0200], Vlastimil Babka wrote: > > Thank you. Tested all the 6 patches in this series on Linux 5.14. This problem > > exists in 5.13 and needs to be marked for both 5.14 and 5.13 stable releases. > > I think if this problem manifests only with CONFIG_PROVE_RAW_LOCK_NESTING > then it shouldn't be backported to stable. CONFIG_PROVE_RAW_LOCK_NESTING is > an experimental/development option to earlier discover what will collide > with RT lock semantics, without needing the full RT tree. > Thus, good to fix going forward, but not necessary to stable backport. Acked-by: Sebastian Andrzej Siewior for the series. Thank you. As for the backport I agree here with Vlastimil. I pulled it into my RT tree for some testing and it looked good. I had to --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3030,7 +3030,7 @@ __call_rcu(struct rcu_head *head, rcu_callback_t func) head->func = func; head->next = NULL; local_irq_save(flags); - kasan_record_aux_stack(head); + kasan_record_aux_stack_noalloc(head); rdp = this_cpu_ptr(&rcu_data); /* Add the callback to our list. */ We could move kasan_record_aux_stack() before that local_irq_save() but then call_rcu() can be called preempt-disabled section so we would have the same problem. The second warning came from kasan_quarantine_remove_cache(). At the end per_cpu_remove_cache() -> qlist_free_all() will free memory with disabled interrupts (due to that smp-function call). Moving it to kworker would solve the problem. I don't mind keeping that smp_function call assuming that it is all debug-code and it increases overall latency anyway. But then could we maybe move all those objects to a single list which freed after on_each_cpu()? Otherwise I haven't seen any new warnings showing up with KASAN enabled. Sebastian