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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 486CAC2B9F8 for ; Tue, 25 May 2021 17:24:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF2CC6135F for ; Tue, 25 May 2021 17:24:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF2CC6135F 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 5C2626B0036; Tue, 25 May 2021 13:24:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 571C76B006C; Tue, 25 May 2021 13:24:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EBF66B006E; Tue, 25 May 2021 13:24:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id 0A2BC6B0036 for ; Tue, 25 May 2021 13:24:48 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 986F8A2AC for ; Tue, 25 May 2021 17:24:48 +0000 (UTC) X-FDA: 78180428256.05.EAC350E Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP id F2AE4C005A2A for ; Tue, 25 May 2021 17:24:41 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1621963486; 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=aYyeinUAq0H1U93rCYr+guudzE86Z5+s4i82KHGINMI=; b=NQF509v5vB4KfKsbys/q0DSbhGkjYiLUf9BIYfndTecQChmKIqd0uz+LwfzpEAuFnjwE8j A92MIdBvMbAJU+2e/f74mAc2peK2iWNebQf5ojro4Y4pLh+wykCxpkyLESt4fRbUnfjEzL DEcNXFZhRfkEFEBgcrbcNu2Et52ohUI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1621963486; 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=aYyeinUAq0H1U93rCYr+guudzE86Z5+s4i82KHGINMI=; b=brrEX2/5HORQBhzlvcrc/7INEzj963Khh8LAk46gx4vJ8uYYDhn4EU3CKGLx1NxYBDeKoS 11qZxR3xa7Dmb+CA== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 80ABEAF32; Tue, 25 May 2021 17:24:46 +0000 (UTC) From: Vlastimil Babka To: Mel Gorman Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Sebastian Andrzej Siewior , Thomas Gleixner , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn References: <20210524233946.20352-1-vbabka@suse.cz> <20210524233946.20352-10-vbabka@suse.cz> <20210525123536.GR30378@techsingularity.net> Subject: Re: [RFC 09/26] mm, slub: move disabling/enabling irqs to ___slab_alloc() Message-ID: <1c9027d9-c6d7-f05d-49a4-a6396a59280c@suse.cz> Date: Tue, 25 May 2021 19:24:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NQF509v5; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="brrEX2/5"; dmarc=none; spf=pass (imf03.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.15 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: zc7hyd56j6pi5i5pbjszchbkb1aii67d X-Rspamd-Queue-Id: F2AE4C005A2A X-Rspamd-Server: rspam02 X-HE-Tag: 1621963481-506583 Content-Transfer-Encoding: quoted-printable 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 5/25/21 2:47 PM, Vlastimil Babka wrote: > On 5/25/21 2:35 PM, Mel Gorman wrote: >>=20 >> Why did you use migrate_disable instead of preempt_disable? There is a >> fairly large comment in include/linux/preempt.h on why migrate_disable >> is undesirable so new users are likely to be put under the microscope >> once Thomas or Peter notice it. >=20 > I understood it as while undesirable, there's nothing better for now. Ah I now recalled the more important reason. By my understanding of Documentation/locking/locktypes.rst it's not possible on PREEMPT_RT to do= a preempt_disable() and then take a spin_lock (or local_lock) which is a mu= tex on RT and needs preemption enabled to take it. And one of the goals is that list_lock would not have to be raw_spinlock on RT anymore. >> I think you are using it so that an allocation request can be preempte= d by >> a higher priority task but given that the code was disabling interrupt= s, >> there was already some preemption latency. >=20 > Yes, and the disabled interrupts will get progressively "smaller" in th= e series. >=20 >> However, migrate_disable >> is more expensive than preempt_disable (function call versus a simple >> increment). >=20 > That's true, I think perhaps it could be reimplemented so that on !PREE= MPT_RT > and with no lockdep/preempt/whatnot debugging it could just translate t= o an > inline migrate_disable? Correction: I meant "translate to an inline preempt_disable" which would = then not change anything for !PREEMPT_RT.