From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D85B3254A9 for ; Fri, 6 Mar 2026 01:48:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772761693; cv=none; b=GyKfLQRqtR3QTKRVt4npa35tfrOlN7AcH2VacMf7mZKLnLSuYs6k0UsqMUa5aDkF3cABglNT6z9ODAlaY/pxSLCuyCE6Pck7tdUgAAto0DPrH/d7pTlp0QdXiCjAb5R/Os5hfxKkRRkn5vuwPe6QQVPAxJJflLCB6Lpl9YVtL8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772761693; c=relaxed/simple; bh=eyv/c64gqWJ9pH8x+VaW8/stjchzC60IaLXpmXv4UOI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jVPUWyLNiUruivz+rosCpnJD7lGUVOAEIOFzwpU7Nz8fHyFoGAIyXqeN8RJBjUcmoEFOythjcDQLnFLouThJMiH/fUNGdf+1w9gofEK4+ut2k2C6OyS/SQmkTmTLiUlXtmcFwpnZCECodJ+hxvCGOumqxafPdss8ga6PhpNHww8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=E+iV8Mle; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E+iV8Mle" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772761688; 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=cxf7FMyoG874zmp11MoqUtyQvevQU1A2APIoEt2g/+M=; b=E+iV8MleOdSpm8wi9tOiu1jpTiqqPsuxk4mrRu8cTq/OP/eIsm2YiFswLekSe9iW+ubjpS i4gE12+US+txNLUC1vyATBuvmcz7asYN05J9l24l5slVZk08c9sSuisl8eQGXFGk4SCw6i A/aBslzXiC5Pw1S5UpGcoV0ICVYL2mk= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-sDZu-UPOMQy4Rs3ZPQLmHg-1; Thu, 05 Mar 2026 20:48:05 -0500 X-MC-Unique: sDZu-UPOMQy4Rs3ZPQLmHg-1 X-Mimecast-MFC-AGG-ID: sDZu-UPOMQy4Rs3ZPQLmHg_1772761683 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2798219560A5; Fri, 6 Mar 2026 01:48:02 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 645F33003E9F; Fri, 6 Mar 2026 01:48:00 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 396B84018D584; Tue, 3 Mar 2026 13:02:13 -0300 (-03) Date: Tue, 3 Mar 2026 13:02:13 -0300 From: Marcelo Tosatti To: "Vlastimil Babka (SUSE)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Leonardo Bras , Thomas Gleixner , Waiman Long , Boqun Feun , Frederic Weisbecker Subject: Re: [PATCH v2 2/5] Introducing qpw_lock() and per-cpu queue & flush work Message-ID: References: <20260302154945.143996316@redhat.com> <20260302155105.214878062@redhat.com> <682380ba-c8f3-4023-928c-2152e934f8db@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <682380ba-c8f3-4023-928c-2152e934f8db@kernel.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On Tue, Mar 03, 2026 at 01:03:36PM +0100, Vlastimil Babka (SUSE) wrote: > On 3/2/26 16:49, Marcelo Tosatti wrote: > > +#define local_qpw_lock(lock) \ > > + do { \ > > + if (static_branch_maybe(CONFIG_QPW_DEFAULT, &qpw_sl)) { \ > > + migrate_disable(); \ > > Have you considered using migrate_disable() on PREEMPT_RT and > preempt_disable() on !PREEMPT_RT since it's cheaper? It's what the pcp > locking in mm/page_alloc.c does, for that reason. It should reduce the > overhead with qpw=1 on !PREEMPT_RT. migrate_disable: Patched kernel, CONFIG_QPW=y, qpw=1: 192 cycles preempt_disable: [ 65.497223] kmalloc_bench: Avg cycles per kmalloc: 184 cycles I tried it before, but it was crashing for some reason which i didnt look into (perhaps PREEMPT_RT was enabled). Will change this for the next iteration, thanks.