Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4245558pxf; Tue, 6 Apr 2021 11:18:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZqJXSvFUg3RyCwF4Z2ObB7V0LrKdQtyJ+WQisC0k+t8EnbiNxZDuOSFs32kKgWuUw7bku X-Received: by 2002:a05:6602:1207:: with SMTP id y7mr24765378iot.23.1617733096727; Tue, 06 Apr 2021 11:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617733096; cv=none; d=google.com; s=arc-20160816; b=E+dCGVLV3Rg48qS7r4qVltmjYlCOgk+qJDtp7gybi1yVY/y5/78lsgUOnSKigDFex9 JEdwCq0Rvm55f1vpiw2CZ6D4GuP4n3BcoPTM6jOROqscC4EpVWIRtzXbrNoBIUo4EzFu 0flkOmLija7tK3nRc5+sP8JjprSoTUUL7uZMNQY+K5nhliew/mEHgKsb/7cQpCkwQvEt EtbQDDke1TS89OivRvQdm9p+9ANRQwMpr0llL2+cX5x2+o1tWt0lnL+S5nuPvVwbU99t Q3/DmTUzXs3smZPfhAvvUHI4SoLLwG8Z/O/5IbRQ50Px8RU3Ow5Qx3IMswqpZuk6MDUV PfSA== 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=TqTPRJB6pZK08YcdPYvz3/pZzL7+uFHBrxcaKm3Xi1A=; b=rQUl+wYuoayXNheylH/8NT8RegW4xGfGCD45HOostK/M3JagoxojhflisVJnbhg29g dhLVaeGzMJeJgPfTac5MCijGgcuaeaNek8s6Pzfz8GPZDdCI9vbg3ySkCcs4tZr5x0Nj 6zypVk8vBav6l4kme5+8xu5pV3jDmQEvNspNGEocbbN8UNuxO1qyhgHsmWGBmS8hnHe3 4c/lomD4Cj1FgZR8MFY7jigcnurD1vOKqdEvusEm7eCDPZxiRzw5prWrRWNs8pspPdAf ETGJsRFiWBUvlj4s/stiOYXgPDrGIAk+gwJdd7hldpmMAf2+I4R6K1w4dpqG9o7pc21T tlmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MrCz+oMa; 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 k3si19190870iop.67.2021.04.06.11.18.03; Tue, 06 Apr 2021 11:18:16 -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=MrCz+oMa; 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 S240752AbhDFJVI (ORCPT + 99 others); Tue, 6 Apr 2021 05:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234721AbhDFJVG (ORCPT ); Tue, 6 Apr 2021 05:21:06 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 570D3C06174A for ; Tue, 6 Apr 2021 02:20:59 -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=TqTPRJB6pZK08YcdPYvz3/pZzL7+uFHBrxcaKm3Xi1A=; b=MrCz+oMav654oV72hg2MNg8+yU gT5QdzdWqliNIecjvZaK4E+bNAdcrX+vCVxCWzhnJ3D3yD7v5zrDD2/MpJTwg9DMnlV+mTCkA2qCz aONRXc99DtkQ2qmxqMzp0X75zhdYceBqf0t37s9wegIN5MUyKRLAhiEhVKv4gMCjSaLKqw+yAZBiA JPpslvFu9852P59/Nvv34Sof3BO8+5CnbJiazNer7u+5RXOm5q8OfvjpxM6JAXDgblBFC0xailfV4 w8U5rb29d+ObCG5VPvfPxVhnz2ZCSyQSKL1lLqjeJf5ZD8pVzu2/TsnZXURmj3uUQFykcp1Gt4gXH xcl8u+VQ==; 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 1lThqJ-00CZLg-7f; Tue, 06 Apr 2021 09:18:12 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EFECE30377D; Tue, 6 Apr 2021 11:17:48 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BB95C2BAE8C25; Tue, 6 Apr 2021 11:17:48 +0200 (CEST) Date: Tue, 6 Apr 2021 11:17:48 +0200 From: Peter Zijlstra To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin , Michal Hocko , Shakeel Butt , Oscar Salvador , David Hildenbrand , Muchun Song , David Rientjes , Miaohe Lin , Matthew Wilcox , HORIGUCHI NAOYA , "Aneesh Kumar K . V" , Waiman Long , Peter Xu , Mina Almasry , Hillf Danton , Joonsoo Kim , Barry Song , Will Deacon , Andrew Morton Subject: Re: [PATCH v4 1/8] mm/cma: change cma mutex to irq safe spinlock Message-ID: References: <20210405230043.182734-1-mike.kravetz@oracle.com> <20210405230043.182734-2-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210405230043.182734-2-mike.kravetz@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 05, 2021 at 04:00:36PM -0700, Mike Kravetz wrote: > The lock doesn't protect any sleepable operation so it can be changed to > a (irq aware) spin lock. The bitmap processing should be quite fast in > typical case but if cma sizes grow to TB then we will likely need to > replace the lock by a more optimized bitmap implementation. Or an rb-tree that stores ranges, which should also be much cheaper storage wise, for those sizes.