Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1601342pxf; Fri, 19 Mar 2021 10:46:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRuexpX7i/M55/mEzFY7UQf+bXQKi7W2qo92rW9CnSnNKqeh1Q6YzlRwNq3G2MTppI1m1n X-Received: by 2002:a17:907:20c7:: with SMTP id qq7mr5532928ejb.528.1616175960771; Fri, 19 Mar 2021 10:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616175960; cv=none; d=google.com; s=arc-20160816; b=FFUzr08tA8oDOCDUCwoUfafItoAk1K/0M5ulGR4sxqlrZ/qGzqkHXZo3BozqHfdU0h CLfwHk7IHkM1ioCyj5OiLLy197mzNW5o5z3ISnI+r6ECJXZyfgV2uNROMFCevITBK+4y fZHsKuiGVg6bSF8ROoAo1roPphb+KnROupcxOmqx/t6Kze/vfzHvf1sfNVKeGofmFwU2 /Mez70Hc/tmC0vDBHB0b9Lq3lyIyw//lCsTTOY9wK1q8JEbSOJhIpTghBKbqsZHzD5V/ xYGBf04u38xTe9fGS1UjvqkoTdiTgpvKuIuN3QiMXpRuhECLv+my8NrPXlJVx2EQDTQk 9Vlg== 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=UJBwv3+scWtdnjoEEcvwzg70Xr2SAona42n3GhDaRo8=; b=Pg2UFEV4ZMkhZnoshfMPgMVnglM0/7C70JCG11xHidxJQFio/HhDho4VF74QEd6XzD SZfphhZaVtPHWjRpbLF6ULpJ/s70O5EdvTQZ4Z2PwW4ArFFiyJWBxjLK5G4/ZOOJdLoQ rGKogOP1FBdhGYj7k8vkv0Nyf4rRG7DV2G+pDNRA313YtoBFqpa9gFfcs+S4qXqdefTx 9wb7erjUfw5QmTc+ivDnsG73DXCZUJ7WjasMwZD8WA4xs8DNYsxsLeZPGVKypLmQ0QAq J08bJW2uWDO6jqgMncHwkVTmQEZqNaMFevHVi74FQweNaHhlTHsV8EOB4gcmwD5jkqDL udTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EGxUeaqh; 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 kk8si4587797ejc.404.2021.03.19.10.45.37; Fri, 19 Mar 2021 10:46:00 -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=EGxUeaqh; 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 S230118AbhCSRl6 (ORCPT + 99 others); Fri, 19 Mar 2021 13:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbhCSRlo (ORCPT ); Fri, 19 Mar 2021 13:41:44 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF43C06174A; Fri, 19 Mar 2021 10:41:43 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 75so11231586lfa.2; Fri, 19 Mar 2021 10:41:43 -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=UJBwv3+scWtdnjoEEcvwzg70Xr2SAona42n3GhDaRo8=; b=EGxUeaqh7gZ6zW6IxD0oLKsRXYcvjWT/cWSuO1zUBl/uag8YlM6DggPJMLLvVkNIei S2EEVQ5ik667esLxtTLddpIkIioh9MLinW0z38Ki2f541TkMMBJwnhkmITSp5n3Inr7P orIP5rLVLcCnDStiRyLf6LzKYbBpbuxaSMV5RWpbKTQzwXLLJFxXoL3WYoSuisEIUelz 7DwTG6v1bYVbYAgDjnjYK+icR7v0u5hWTeIrQKQvz2O1YgoFZPfA4SpEBT61dSOkx/au pMywlyy1DFBD3weNpN2m4kGG0CkWRvKEqH/GUJnWy4ZHkHfXazRLhQIavFCjfwrqno0l 3QHQ== 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=UJBwv3+scWtdnjoEEcvwzg70Xr2SAona42n3GhDaRo8=; b=fIJHHnqxvygYfy0dVZDVSP6XUZ5ddNCkT7BWYJ2aj9adi/X1FvnPpoElYafzF1gsdF HmjLwB/1HIkj3+0vsPTWU9blYQphwP/jORW90NnA7+i5Q+UmGuFlA61FNp3Ks8kk71de i2bozKscARXUoABF2TALP2SYFSPr4K/EAJTIkrBGf6yUtXu9t0KvLHiiZMSCWJhAgCf2 h+txBKI8GInYNHttqiRRwcaQrI/586z72lThgSLd7z93cbfCS8XdogK2+N/iGatpVn+p 7sSkSiE6z9zsJom39UrKMSINyaK31w24Vp7ELZUYVqUftc4zPeBbgZskv0GJSdLOQkB8 6lrg== X-Gm-Message-State: AOAM533Y3ZJYrGHrDnswqePGGty2XoZXxS23fMBJlx/xd2xcDA8VrTry dOtcCtUBMEgnlruLS5nporMAMMrBSQg= X-Received: by 2002:a19:e48:: with SMTP id 69mr1327591lfo.469.1616175702251; Fri, 19 Mar 2021 10:41:42 -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 192sm847746ljj.95.2021.03.19.10.41.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 10:41:41 -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:41:40 +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: <82bde114-60c0-3fde-43f4-844522b80673@gmail.com> 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: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?