From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4C7BC63697 for ; Thu, 26 Nov 2020 13:38:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D21A221EB for ; Thu, 26 Nov 2020 13:38:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="a0N4KrUD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390180AbgKZNiG (ORCPT ); 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