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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 22791C2B9F4 for ; Mon, 14 Jun 2021 12:54:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E729613F1 for ; Mon, 14 Jun 2021 12:54:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E729613F1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3423A6B006C; Mon, 14 Jun 2021 08:54:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CB236B006E; Mon, 14 Jun 2021 08:54:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F6F16B0070; Mon, 14 Jun 2021 08:54:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id CCFED6B006C for ; Mon, 14 Jun 2021 08:54:33 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 53A328249980 for ; Mon, 14 Jun 2021 12:54:33 +0000 (UTC) X-FDA: 78252323226.40.F9347DE Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf14.hostedemail.com (Postfix) with ESMTP id 21483C00CBFF for ; Mon, 14 Jun 2021 12:54:24 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6746721983; Mon, 14 Jun 2021 12:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623675271; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zSv+sJ04/VrDDdXP1Ew6xJk3kC/8M6pl/QyYQ0sfx/g=; b=zPiPQ4cMCHnjijKoZx3/uHdLJdbamgesELOq/WtUi4NuWTcPSqp0LXPrIHhf01wbfJ/FEK hVNf0UMNF4EKMBvP69RI6MvEXFxPd8QHW7BqBclANJ3hUxi9JmpzQtV9cqctDZLL4ofw3j YuKScwfIAzsgbhpeguSlAnQCR0gboqc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623675271; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zSv+sJ04/VrDDdXP1Ew6xJk3kC/8M6pl/QyYQ0sfx/g=; b=1JkZwNDxW/Q5eWgFNs7jDLcifx/lXbTpjhqQy/WX2zalr8oDNXALbpB5GQSrfTbPqvWjcg VNASNmz/2JHNsMBw== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 3F4A4118DD; Mon, 14 Jun 2021 12:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623675271; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zSv+sJ04/VrDDdXP1Ew6xJk3kC/8M6pl/QyYQ0sfx/g=; b=zPiPQ4cMCHnjijKoZx3/uHdLJdbamgesELOq/WtUi4NuWTcPSqp0LXPrIHhf01wbfJ/FEK hVNf0UMNF4EKMBvP69RI6MvEXFxPd8QHW7BqBclANJ3hUxi9JmpzQtV9cqctDZLL4ofw3j YuKScwfIAzsgbhpeguSlAnQCR0gboqc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623675271; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zSv+sJ04/VrDDdXP1Ew6xJk3kC/8M6pl/QyYQ0sfx/g=; b=1JkZwNDxW/Q5eWgFNs7jDLcifx/lXbTpjhqQy/WX2zalr8oDNXALbpB5GQSrfTbPqvWjcg VNASNmz/2JHNsMBw== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id 9/TWDodRx2DhRAAALh3uQQ (envelope-from ); Mon, 14 Jun 2021 12:54:31 +0000 Subject: Re: [RFC v2 33/34] mm, slub: use migrate_disable() on PREEMPT_RT From: Vlastimil Babka To: Sebastian Andrzej Siewior Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn References: <20210609113903.1421-1-vbabka@suse.cz> <20210609113903.1421-34-vbabka@suse.cz> <20210614111619.l3ral7tt2wasvlb4@linutronix.de> <390fc59e-17ed-47eb-48ff-8dae93c9a718@suse.cz> Message-ID: <0edf0478-17ed-4120-22e1-b61ad9bddeec@suse.cz> Date: Mon, 14 Jun 2021 14:54:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <390fc59e-17ed-47eb-48ff-8dae93c9a718@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 21483C00CBFF Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=zPiPQ4cM; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=1JkZwNDx; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=zPiPQ4cM; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=1JkZwNDx; spf=pass (imf14.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Stat-Signature: 67794wsz5qskbkkmskn37k6ek59m1pbr X-HE-Tag: 1623675264-687447 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 6/14/21 1:33 PM, Vlastimil Babka wrote: > On 6/14/21 1:16 PM, Sebastian Andrzej Siewior wrote: > But now that I dig into this in detail, I can see there might be another > instance of this imbalance bug, if CONFIG_PREEMPTION is disabled, but > CONFIG_PREEMPT_COUNT is enabled, which seems to be possible in some debug > scenarios. Because then preempt_disable()/preempt_enable() still manipulate the > preempt counter and compiling them out in __slab_alloc() will cause imbalance. > > So I think the guards in __slab_alloc() should be using CONFIG_PREEMPT_COUNT > instead of CONFIG_PREEMPT to be correct on all configs. I dare not remove them > completely :) Yep, it's possible to get such scenario with PREEMPT_VOLUNTARY plus PROVE_LOCKING - CONFIG_PREEMPTION is disabled but CONFIG_PREEMPT_COUNT is enabled, and RCU then complains in the page allocator due to the unpaired preempt_disable() before entering it. I've pushed a new branch revision with this fixed: https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=slub-local-lock-v2r3