Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp728657pxt; Fri, 6 Aug 2021 12:13:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3REmcmdpyFTIJj67tfPUykZpyHUbpGt80B7vqWsWxsWhugxXR12TuzG9y9ak1AABHfnyc X-Received: by 2002:a05:6638:114:: with SMTP id x20mr11022214jao.118.1628277220292; Fri, 06 Aug 2021 12:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628277220; cv=none; d=google.com; s=arc-20160816; b=j498lguufBh22lZ8+0ZjPUZJ9vDhb4izQ5FKpSQdGW2RNtLD+LIpn3VsWjvlTrICSo WjfYxNDSdhZ7bWd/rG0m2Wda5GqBuqJ/f2Z5RZy0zPFm55gk5PkllVQAFVJPRIc31ntn yL9injjKoXcR+sFo4M3VpGcJFE0kIaMRXBjupbR/9mzxtMSL5TlKnISLLVCBzDH8lfDE PaDunK8krKtF0RXGbppH4iGqsyyNSIuBA8eHUUP44zOHu3chgkWHsBvYDhDZlLzxSjcE //YZCYRD0OyWhYpm71HrNfN5nJeSLXrN6uOuB8Q059JoHJK4DmTA7dqDqpfBpbcsF1Up XJ5A== 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:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=fVnQMqrob9/IFuGf5EbNL3WQENObUrkXU+LC4+olYdY=; b=LZo0MGa+DpzcXa5OYBsD3v8hdI0LSw1qIB7r1wQ1LJeeXJLIKdVZtVnfbI1UyWu8Ku 3nzaBFrOecriw2vKYVI/Kvx991riQl90mjDf0l+CrKHYwsRgcNFtEN/RlGq7aC7YN/2Z WHQ2/IonSGnaNlTiGSPfz9iRjVnRC5pHbJG2GJEznPPeYnDDs0mEokZErRn/2WNiFsJZ 6+XpZjuy7kdFkH6NddQuvawQiq3Q2Ow+rSgTDOYC82Lo+RfAS4GgqUc1HBwR6DU3ygrO 3eJrrlaRLXFFhEIUnancBAvC3OvgE/uqJmbcIPPxg94iN802gBOin1AvwXJNiUe3qY9r r9uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=yikrRqNK; dkim=neutral (no key) header.i=@suse.cz; 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 y1si6328423ily.127.2021.08.06.12.13.26; Fri, 06 Aug 2021 12:13:40 -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=@suse.cz header.s=susede2_rsa header.b=yikrRqNK; dkim=neutral (no key) header.i=@suse.cz; 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 S1343764AbhHFMjO (ORCPT + 99 others); Fri, 6 Aug 2021 08:39:14 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:42022 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343743AbhHFMjL (ORCPT ); Fri, 6 Aug 2021 08:39:11 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 466E722238; Fri, 6 Aug 2021 12:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628253535; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fVnQMqrob9/IFuGf5EbNL3WQENObUrkXU+LC4+olYdY=; b=yikrRqNKDzssgPajRQZtzuJzAdAgmFAi8Q7QuojndI5AoZIPHbeq22FZXncR0jfjYYRv6s nFMlgnvNJqDjiVNHUNVKBRmoT53NKFyGtWrBIpNFUb6Lq5c66y76S9jdxRZXr1mNgiD8nh bmL4Mn3RjNgSW4tO23hcKpHXTuj4be4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628253535; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fVnQMqrob9/IFuGf5EbNL3WQENObUrkXU+LC4+olYdY=; b=Li6bD+Fg/AYldNcFmarfwiFRStRjdnW2AX7iH8+FMFKnyvDMhpJfgRQ7SP3cEFB4XRE8Ro 4gzyYiytkmhxQSAg== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 1BF5413A82; Fri, 6 Aug 2021 12:38:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id WjdwBV8tDWF5dwAAGKfGzw (envelope-from ); Fri, 06 Aug 2021 12:38:55 +0000 Subject: Re: [PATCH 1/1] mm/vmstat: Protect per cpu variables with preempt disable on RT To: Mel Gorman , Andrew Morton Cc: Thomas Gleixner , Ingo Molnar , Hugh Dickins , Linux-MM , Linux-RT-Users , LKML References: <20210805160019.1137-1-mgorman@techsingularity.net> <20210805160019.1137-2-mgorman@techsingularity.net> From: Vlastimil Babka Message-ID: Date: Fri, 6 Aug 2021 14:38:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210805160019.1137-2-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/5/21 6:00 PM, Mel Gorman wrote: > From: Ingo Molnar > > Disable preemption on -RT for the vmstat code. On vanila the code runs > in IRQ-off regions while on -RT it may not when stats are updated under > a local_lock. "preempt_disable" ensures that the same resources is not > updated in parallel due to preemption. > > This patch differs from the preempt-rt version where __count_vm_event and > __count_vm_events are also protected. The counters are explicitly "allowed > to be to be racy" so there is no need to protect them from preemption. Only > the accurate page stats that are updated by a read-modify-write need > protection. This patch also differs in that a preempt_[en|dis]able_rt > helper is not used. As vmstat is the only user of the helper, it was > suggested that it be open-coded in vmstat.c instead of risking the helper > being used in unnecessary contexts. > > Signed-off-by: Ingo Molnar > Signed-off-by: Thomas Gleixner > Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka