Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1580824pxf; Fri, 9 Apr 2021 11:59:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlW744lj5Hz7o4iz/qa9GNB4qlO1F2kNeZIJDZ42mE7oPHjRejB6hc1JwpnZr+yCJtVcuO X-Received: by 2002:a17:90a:eb04:: with SMTP id j4mr3512317pjz.156.1617994794164; Fri, 09 Apr 2021 11:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617994794; cv=none; d=google.com; s=arc-20160816; b=n07cwqxW3ShXdwfxyWioxQRdE/iLX3mW6FzHo1epqwTXFtXCoug3BGNf2QKIyTMgps juaTXVZYAHiLyAVsVKH4XYMx1qMtwoYNPnik+Zm9FHZBp03vWrf6mn8A8HTPobdhColF Cgf1q+bFVH3zlIMpMLFBD5ivVhvi59Xz9zja4VOe4bFxpEeAD5lp0kVydvGui2cfy92W dXAy/zKRIRVPbsdA0arGYmVelPFWG8OCZD5upqg0+fpS1KNJbrHQbdOiJg66YhsK4Po/ 1PbBYTZamUyGhd8PgxqPUJo5OFep97sEnQOZK702OSm+5RKNq3nyszpb+q+NUrSoAdVQ 0Vsw== 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:date:dkim-signature; bh=Ty1LGS3v38Chtaw1svPzlAmEjDpxvcnRksGoyQD0C+o=; b=E9awKMzKI28YHwyop51e7oGQQ8FuHsVj64QVAiNOkRsDvkUASLwiPtxnRC79g/pKQ5 craGQmtVwaOeypiV0dowNye2opSdLLyCC6PUpJAncWiW9PF+K26Tpn7YP6O3CZnmOgUA HQZ1/wGabTYi+d4OfRrAHPRYliA/YomNSWMzzxSLIh1rZSKvMd1fAf3hH9TFb+1a4gr1 FxNxHw2IPMOlllGLn+TFsoei7EhTWzlYarfHloSjWozsBnKnzRuSZN8lTos5DI/N0f9g n3t3y8An2I04DfJJngEQCRVQFb9z+9bZg5l9M+h50FrQqh7nZcqBs6Ey9qTlB0tYav86 wqgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dllxp3SI; 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 g16si3850122pfi.92.2021.04.09.11.59.42; Fri, 09 Apr 2021 11:59:54 -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=@infradead.org header.s=casper.20170209 header.b=dllxp3SI; 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 S234806AbhDIS5x (ORCPT + 99 others); Fri, 9 Apr 2021 14:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234666AbhDIS5v (ORCPT ); Fri, 9 Apr 2021 14:57:51 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B46FC061763; Fri, 9 Apr 2021 11:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Ty1LGS3v38Chtaw1svPzlAmEjDpxvcnRksGoyQD0C+o=; b=dllxp3SIl7dJb2SWmtFHijzg05 BMWCiqHMAwP4HIGF0KTqW8xzuklitWYigJdw70af2VurVYfGvC7Oxm2N2raBt/q53boGyBc7YtFNr 8AJ3+yj8A3//tQz4Ef/5qaFW+VjQZcybr1RAOmVc/1cVU4jbdipfQjWS2Nok/eYyRSImo4LElQ4bV yifBHCzF1ZT+TFNmmDcUT/sw8pPkUQneDX0gLUrNG9eFz1kwz87nDBEauMz2d2WnZVP4U6XR0pVf4 BnKVa8aQrBqviiX7uH2lUu0jO0ntht0Ii8YGU6z3b3t6GArBRGhx7VAjAYt90WlB/0VHg/tdBvekJ JoY5ctFw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lUwI9-000nMk-Lg; Fri, 09 Apr 2021 18:55:50 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D6AD730001B; Fri, 9 Apr 2021 20:55:39 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BEDE52C49B0B8; Fri, 9 Apr 2021 20:55:39 +0200 (CEST) Date: Fri, 9 Apr 2021 20:55:39 +0200 From: Peter Zijlstra To: Mel Gorman Cc: Linux-MM , Linux-RT-Users , LKML , Chuck Lever , Jesper Dangaard Brouer , Matthew Wilcox , Thomas Gleixner , Ingo Molnar , Michal Hocko , Oscar Salvador Subject: Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock Message-ID: References: <20210407202423.16022-1-mgorman@techsingularity.net> <20210407202423.16022-3-mgorman@techsingularity.net> <20210408174244.GG3697@techsingularity.net> <20210409075939.GJ3697@techsingularity.net> <20210409133256.GN3697@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210409133256.GN3697@techsingularity.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 09, 2021 at 02:32:56PM +0100, Mel Gorman wrote: > That said, there are some curious users already. > fs/squashfs/decompressor_multi_percpu.c looks like it always uses the > local_lock in CPU 0's per-cpu structure instead of stabilising a per-cpu > pointer. I'm not sure how you read that. You're talking about this: local_lock(&msblk->stream->lock); right? Note that msblk->stream is a per-cpu pointer, so &msblk->stream->lock is that same per-cpu pointer with an offset on. The whole think relies on: &per_cpu_ptr(msblk->stream, cpu)->lock == per_cpu_ptr(&msblk->stream->lock, cpu) Which is true because the lhs: (local_lock_t *)((msblk->stream + per_cpu_offset(cpu)) + offsetof(struct squashfs_stream, lock)) and the rhs: (local_lock_t *)((msblk->stream + offsetof(struct squashfs_stream, lock)) + per_cpu_offset(cpu)) are identical, because addition is associative. > drivers/block/zram/zcomp.c appears to do the same although for > at least one of the zcomp_stream_get() callers, the CPU is pinned for > other reasons (bit spin lock held). I think it happens to work anyway > but it's weird and I'm not a fan. Same thing.