Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1601466pxf; Fri, 19 Mar 2021 10:46:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuT/gSC01bta65Lw2fGwvc8EngFTzw0JOF2wCTDdilT9BhdVQvLENN7t5aEqmtLox2T3Sx X-Received: by 2002:a17:906:cc89:: with SMTP id oq9mr5668209ejb.258.1616175974150; Fri, 19 Mar 2021 10:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616175974; cv=none; d=google.com; s=arc-20160816; b=gZ/on352jHNREuApq7QRq5a//9BRbXWiZkmTKaGsE3mZ2d0Jjja7BbVU5LKk67QUqc wMAFPmYVvbbBPYot0YMTolqI2ozTYgECxWKzAQyHBa8gapeLZbODkoTPWZ9KHgU2hyc7 0V6F87zN3wCoquPwrzqL7f7NhpcTtOwfSTfjLgLqBhmecjFtSAEc4S3P+JY7hycYJD2z KlSpkLAxM0awbho75iXbF4soxvRWwI6cWm5tcDW4sVITBNvFzK8jN4Oikwf1WyCfsSdh JUTCSwAcZephHcqguo3oadTTqipPQIr3/lUdpXks8wi3UzzNYyiu0QY8iHRZrAKWlEyD Rh+w== 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; bh=gq4UIk+ByEdA/Jn9oEYE7L3pIna4OdrooJuJgf5IZnk=; b=AbrNkB5VAJ/rfW0+JaiOLmAE3QESlplmdlQVgszsUCI5FvhluzeNjq8abSncwgAT8p iVfnL9n9JXeQgY98qhv70czT3qc5eE/YyjOglPWMHztSicZJCcfQkzeOzk2HVO9GFhh2 mSD1HKw5ke4erudcCK636AgaUd6FZZXtFt8mGarDStD7pUEOQfi7H/cZdYhTdAbrtPmU LXY4P9Ag87/dP1rPJgPk83t+yObHIFi617P+KuKpZHYSevMPOe1GFNW2Hm2gvwiSRQOc FTly5Hl+xNM0VkPj0QZdYV0fFOt2eM5vEww5KkB7VN912tQUxQhiiSZJWCznd+fC0TLK Z0bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uMS9Ttr4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg2si4735352ejb.233.2021.03.19.10.45.50; Fri, 19 Mar 2021 10:46:14 -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=@gmail.com header.s=20161025 header.b=uMS9Ttr4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbhCSRoj (ORCPT + 99 others); Fri, 19 Mar 2021 13:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbhCSRoM (ORCPT ); Fri, 19 Mar 2021 13:44:12 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCA7DC06174A; Fri, 19 Mar 2021 10:44:11 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id f3so2899542lfu.5; Fri, 19 Mar 2021 10:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gq4UIk+ByEdA/Jn9oEYE7L3pIna4OdrooJuJgf5IZnk=; b=uMS9Ttr4YOy2CbXHUE4FhhR3hZMFun1WDEUYtrYbtMLHcT++dD6nYgKvBT2ZR/PByh cudf3+Zx7IO6Z/V2yjkIBkBasjdD/zcGulHderIjLybhn1jWEEvotzkxN9jDEw5NMyc9 s0CwM5LXfynfaj7Ij8eoqJLRt2dO7x/z4K915KJr6Qfz0eqBj0qcELhCVR13BMx5yUvq yyFvqUwAQ+EaxFWPjnM5u1Pz4s5pln+2AhrKTVfsxmvK2SaY1fTWZ8mhAD2OjPU0kwVM vNdvmMOVXhTxPZNx/Dc0JiyaUx50MzUOnYU/nCt/V6C/QpinpgReJ9LFVnmlVIRdjZOx PRvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gq4UIk+ByEdA/Jn9oEYE7L3pIna4OdrooJuJgf5IZnk=; b=WvY8vU9XA995aHQP7ReOuoQjfK4C+A6r01G0HEkLUd4Z2tMGRc/btprdH6zrsLwmOM KopIeBJnOz7/5i/QYExPrG3CUqPof7ll0xDnCbw5CVMeQPnpuQnpsC2Mbc8rx4FC3Tvh 2XEyHxf3Hlyvsn45SgpVrWR1ILGiTX9RpspIWclg/RjZ1A1Jkp0Uw79P2a20qMlAqIru HYIUehVkdx6hxDqBe42cFOcce+8yapZLYrpxQg8bEt7Kmji9dNYm3Qj8VYvdr/RmkqXZ hJ7j4JrstWin1TU8gK+PuVieLzI/Cdaax13a1OUpHgjxaSg8YgZbtKSkaPyyc6X/HE67 8QPg== X-Gm-Message-State: AOAM5310mbq6sfnVPPJaLlmkJ1Y0BlB+LNNsIl0CE7ISZVpO5GRYSX5b 1V/FELO+iiEugs4u8o51jwlWJzRP5Yk= X-Received: by 2002:ac2:53a1:: with SMTP id j1mr1472374lfh.298.1616175850302; Fri, 19 Mar 2021 10:44:10 -0700 (PDT) Received: from [192.168.2.145] (109-252-193-52.dynamic.spd-mgts.ru. [109.252.193.52]) by smtp.googlemail.com with ESMTPSA id a1sm698495lfh.142.2021.03.19.10.44.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 10:44:10 -0700 (PDT) Subject: Re: [PATCH v4] mm: cma: support sysfs From: Dmitry Osipenko To: Minchan Kim Cc: Greg Kroah-Hartman , Andrew Morton , linux-mm , LKML , joaodias@google.com, willy@infradead.org, david@redhat.com, surenb@google.com, John Hubbard , Nicolas Chauvet , "linux-tegra@vger.kernel.org" References: <33ec18ef-8652-643a-1a53-ff7c3caf4399@gmail.com> <78883205-e6da-5bc4-dcec-b6eb921567b1@gmail.com> <72db59eb-75dc-d1ed-7a83-17052e8f22a8@gmail.com> <82bde114-60c0-3fde-43f4-844522b80673@gmail.com> Message-ID: Date: Fri, 19 Mar 2021 20:44:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 19.03.2021 20:41, Dmitry Osipenko пишет: > 19.03.2021 20:29, Dmitry Osipenko пишет: >> +void cma_sysfs_alloc_pages_count(struct cma *cma, size_t count) >> +{ >> + atomic64_add(count, &cma->nr_pages_succeeded); >> +} >> + >> +void cma_sysfs_fail_pages_count(struct cma *cma, size_t count) >> +{ >> + atomic64_add(count, &cma->nr_pages_failed); >> +} > > The atomic looks good, but aren't CMA allocations already protected by > the CMA core? Do we really need to worry about racing here? > Although, please scratch that. I see now that these functions are called outside of the lock.