Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2726910pxj; Mon, 14 Jun 2021 05:55:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBBplJjOPF3Tb9vrjlsgnvVlEdlLtQ0tSHH62ZIcofpgujFYJgyYpO53a7Ry0pjkXLpA9E X-Received: by 2002:a17:907:2156:: with SMTP id rk22mr14922363ejb.464.1623675356073; Mon, 14 Jun 2021 05:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623675356; cv=none; d=google.com; s=arc-20160816; b=klqn5FvZimv8UXEorzr6szWnZaVC942Lc3FxKGlTxf9gzsqj+jG1jzJjM1m+9MZI/9 DTAFlNpoDMMsYSzkctnLd9g9CVvsLKrGpyomtUWmkYawNMcFhhjmBtbmPbcmGPuw7gdH GhvQqpTmRR65pGCHfVreD3m3X5K839jQdFnqdNow5zzBsvsYuB/HyCK9W24GCxht+YPo LAGn5P8lJlNjijatfZwT1QnazO2s55ckReTSQ/XYG1K36ke/LXoVUOqCp/8p2caWSWZU P1+pjYIIqIiA0+W0ksTSjhkCkQmvxTKl9TAmI+RT/qRvkLCdUz5c1nXogVcLBk6Q1d5l BFpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=zSv+sJ04/VrDDdXP1Ew6xJk3kC/8M6pl/QyYQ0sfx/g=; b=qNj5G/hM51ZYMS3lPqUQ7mfH4iXGs86oeXlX48TII2v06OXF7oUqyeJzhjGvdK0/7A KVQ/N2QvKlEqltm+PhOF0551MAbDXno5w5TkBZqsuTqOjSxsx1wUR1KLE4nccEA0Xtb9 wgGZTQebUn6W9iPncSU9WgSXvYsqec9T0aL1noH0OvMFyBD11oeFkaX0ahWoBAA9Q122 vP52cSO5eeDY9P8w1UiqWjqB/s4TyYTLA+RRuGM72vuWejss2V8n6SZehjUlYMGCtQbZ dtsp38hOJbyDN7pBFEwkWt+oWkzwMEWcYOIQ5WYYkly/mJN0sDoaAkjYhXIrjnwIxqCg G6QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=zPiPQ4cM; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=zPiPQ4cM; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kg16si10719516ejc.751.2021.06.14.05.55.33; Mon, 14 Jun 2021 05:55:56 -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=@suse.cz header.s=susede2_rsa header.b=zPiPQ4cM; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=zPiPQ4cM; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233304AbhFNM4j (ORCPT + 99 others); Mon, 14 Jun 2021 08:56:39 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:38960 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233218AbhFNM4e (ORCPT ); Mon, 14 Jun 2021 08:56:34 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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