Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp553373pxu; Thu, 26 Nov 2020 05:41:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKPMwpyYTmEUDxGKzA2REVR0uznO/Z7go3Tb5g1gYXhaPbbx8IWcys8d2NLrn/VfzSG/i1 X-Received: by 2002:a17:906:c096:: with SMTP id f22mr2608148ejz.488.1606398117218; Thu, 26 Nov 2020 05:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606398117; cv=none; d=google.com; s=arc-20160816; b=cTwKs9cPxdNdThC4SYKBvkZCpGX4rc16LsHqaRBwjqzeVCgWB+o2l4dsodGjFwIEuP o3xBPw9q3FZGMWMyqbLiX8cqJHx7sswSUa0nzIBzQVZ06Q/4d12FvX+FCw/CSbFDi66m VotcGUF/hACHoTEhT8Qg39i4YbBUMK6kyGC2ANTqi54azwtd7Y9P5Ec1DYA8q8jv7TjB /e9vw3D1yPVR28jviBR7pTqloXVQJ+34HHT8lRY7WC95cJNmgKSUvg4UygaWoSFPXAP+ R79Gh7XV+1nbtkLZDZqjL2PwYQozRN4J8+QuLl5DXZHb90jUFOQ+C4EOZ6owYNRxbLbk xeUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=G/pChsn4fN3Vyl1crrOE4ndzcerWTWr/tVT2Qyr7i24=; b=gOonGaFqxuVKz7xdHHWLJXzVrxk6XhYEce18MTaG1FrMIhWfhWP/+oQhRSEw8OzBkF X0m+i2slxmjN69VIfxl3bynK/I1EWl7gDe5am98cZY+/W+fLp7g8nbubbIFwq2rNeKdq IuTewhRUklabZss+udiiWFEA1iUoxkQkgW9o6CShkRdUuFUKYd28UcBqw6E0DGWfkCha 6iezSjOgbS7D0ZEw/8qTQ9d1EZZIIplVui1NmJLp+3DLilfLUzwAJ2N9R5VKdF88kdqD 4OeViXI2GQtj0aBUeHe8JsuveEx8czrBTkFE1DV5ZsLIUo2IPc8u3z+BBku5bStnVKg7 OxWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=a0N4KrUD; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si3073574edm.45.2020.11.26.05.41.34; Thu, 26 Nov 2020 05:41:57 -0800 (PST) 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=@amazon.com header.s=amazon201209 header.b=a0N4KrUD; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390168AbgKZNiG (ORCPT + 99 others); Thu, 26 Nov 2020 08:38:06 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:6228 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389878AbgKZNiF (ORCPT ); Thu, 26 Nov 2020 08:38:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1606397885; x=1637933885; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=G/pChsn4fN3Vyl1crrOE4ndzcerWTWr/tVT2Qyr7i24=; b=a0N4KrUDQki8GNjEhJ+VOiXpMARJjCuSucNavaBxCp6F1JdyUoB2Rsxu caV/jIcwDnWrA1NFpP2JffUtnDYyEQuxGL5RYSa7SR8NOXzBarNVrfsXD Xgj6nExgt8+lDWDXRO/mkgxlQlXyMKaH9LHzTE6LlLJEfYm3ENmkAHxQq k=; X-IronPort-AV: E=Sophos;i="5.78,372,1599523200"; d="scan'208";a="66219790" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 26 Nov 2020 13:37:58 +0000 Received: from EX13D31EUA001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) with ESMTPS id A071FA21E3; Thu, 26 Nov 2020 13:37:46 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.160.229) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 Nov 2020 13:37:30 +0000 From: SeongJae Park To: Shakeel Butt CC: SeongJae Park , SeongJae Park , , Andrea Arcangeli , , , , , , Brendan Higgins , Qian Cai , Colin Ian King , Jonathan Corbet , "David Hildenbrand" , , Marco Elver , "Du, Fan" , , "Greg Thelen" , Ian Rogers , , "Kirill A. Shutemov" , Mark Rutland , Mel Gorman , Minchan Kim , Ingo Molnar , , "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , Mike Rapoport , , Shuah Khan , , , Vlastimil Babka , Vladimir Davydov , Yang Shi , Huang Ying , , , Linux MM , , LKML Subject: Re: [PATCH v22 07/18] mm/page_idle: Avoid interferences from concurrent users Date: Thu, 26 Nov 2020 14:37:15 +0100 Message-ID: <20201126133715.4468-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.229] X-ClientProxiedBy: EX13D11UWC003.ant.amazon.com (10.43.162.162) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Nov 2020 07:30:27 -0800 Shakeel Butt wrote: > On Tue, Oct 20, 2020 at 2:06 AM SeongJae Park wrote: > > > > From: SeongJae Park > > > > Concurrent Idle Page Tracking users can interfere each other because the > > interface doesn't provide a central rule for synchronization between the > > users. Users could implement their own synchronization rule, but even > > in that case, applications developed by different users would not know > > how to synchronize with others. To help this situation, this commit > > introduces a centralized synchronization infrastructure of Idle Page > > Tracking. > > > > In detail, this commit introduces a mutex lock for Idle Page Tracking, > > called 'page_idle_lock'. It is exposed to user space via a new bool > > sysfs file, '/sys/kernel/mm/page_idle/lock'. By writing to and reading > > from the file, users can hold/release and read status of the mutex. > > Writes to the Idle Page Tracking 'bitmap' file fails if the lock is not > > held, while reads of the file can be done regardless of the lock status. > > > > Note that users could still interfere each other if they abuse this > > locking rule. Nevertheless, this change will let them notice the rule. > > > > Signed-off-by: SeongJae Park > > I don't think this is allowed. I mean returning to user space with > held mutex and other processes can unlock it. I don't think mutex is > what you need. Or more importantly is this really an issue? > In a separate call, I and Shakeel agreed on that this is trying to fix an issue that aren't proved real. So I will drop this patch in next version of the patchset. We can restore this patch or find better fix later if the problem comes out in real. Thanks, SeongJae Park