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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 DB94EC33CAA for ; Thu, 23 Jan 2020 07:29:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9A912217F4 for ; Thu, 23 Jan 2020 07:29:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xa57PKd6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A912217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2086C6B0003; Thu, 23 Jan 2020 02:29:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B9BE6B0005; Thu, 23 Jan 2020 02:29:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 082226B0006; Thu, 23 Jan 2020 02:29:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id E3FC46B0003 for ; Thu, 23 Jan 2020 02:29:15 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 97E2C381E for ; Thu, 23 Jan 2020 07:29:15 +0000 (UTC) X-FDA: 76408073070.19.knee68_50bd5eb0e6128 X-HE-Tag: knee68_50bd5eb0e6128 X-Filterd-Recvd-Size: 5399 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jan 2020 07:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579764554; h=from:from:reply-to:subject:subject: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=uxkPb3Lql6EaZOuXZ2JUej1FFCvaRjdJBVw9vZSgZXA=; b=Xa57PKd6CHs1v55rHZq02bvHj7O5sGM/m29RAcw5tUPZuPTUoIxRPR0r2Fjg5VwLqPZEyg //JWtDd7c1PhFl0AlCrwHBRJsyKy61g6Y6n9KF21B4Wsaio1ZnAl/eQjGLlNExZxN+tRGJ bU4mXaIVSrEQvnJPZOFsR/kfLuzzGVI= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-240-Y5-OHj86ODa6ihavSnUMZQ-1; Thu, 23 Jan 2020 02:29:07 -0500 Received: by mail-wr1-f71.google.com with SMTP id f17so1309157wrt.19 for ; Wed, 22 Jan 2020 23:29:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Swf1miaJ2KibF1rWEltK6FB4Al/NU26D9Z8MNRvgV1o=; b=IhlVFTuuN7GkapHTWX/JeYky5RMMqIPFPOLblhA59ygTy8EvzibE4triZMjX2usKiC pUJ1n5BUP2C3mSptq6438ElYbQNqaUPGdc7k/1C9uQVZ9cpjd0LEylQAX75DMyclZR28 BrYfcXbh3qcoUfGmYQiokc+xGhViZtGKelB52v9k0xVaFcp5xdPozhN8WR0TZwAP57UH MVazcxKN8iIG68B8QbZu+YJhne/WahQvQDGnz5AlsnI9g/s+LEo956N+cSz65En1RXjo bXr+4tKoXTFRPYjjWjdIp87SZyDMc+EA+htq8GyvCu0xsNbtdFM2yTCXDmoZUaraQEn4 2Kgw== X-Gm-Message-State: APjAAAVeuUrZnwFt0rTXYmKTTCNg7yaTeoKXhEmboInbNEN/ZHOAFoRE uPJlfk3/BRuoctW73kK3aFauV8cv3CYeVFkrmE9U6AiKRsgIt89nGg4Aq6PRN3BdPO2b6beTDCX jOD+OdIa8x5A= X-Received: by 2002:adf:fe0e:: with SMTP id n14mr16615730wrr.116.1579764546611; Wed, 22 Jan 2020 23:29:06 -0800 (PST) X-Google-Smtp-Source: APXvYqynoI3k83YYvEjN9Vq70/cg2K/88hFd6YtoeaGnpbIqaxUURJKASpUHj31Q/0KxCIPHp2utJg== X-Received: by 2002:adf:fe0e:: with SMTP id n14mr16615675wrr.116.1579764546241; Wed, 22 Jan 2020 23:29:06 -0800 (PST) Received: from localhost (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id a9sm1509848wmm.15.2020.01.22.23.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 23:29:04 -0800 (PST) Date: Thu, 23 Jan 2020 08:29:04 +0100 From: Oleksandr Natalenko To: Minchan Kim Cc: "Kirill A. Shutemov" , Michal Hocko , Andrew Morton , LKML , linux-mm , linux-api@vger.kernel.org, Suren Baghdasaryan , Tim Murray , Daniel Colascione , Sandeep Patil , Sonny Rao , Brian Geffon , Johannes Weiner , Shakeel Butt , John Dias , ktkhai@virtuozzo.com, christian.brauner@ubuntu.com, sjpark@amazon.de Subject: Re: [PATCH v2 2/5] mm: introduce external memory hinting API Message-ID: <20200123072904.ludphxkxseyg2qli@butterfly.localdomain> References: <20200116235953.163318-1-minchan@kernel.org> <20200116235953.163318-3-minchan@kernel.org> <20200117115225.GV19428@dhcp22.suse.cz> <20200117155837.bowyjpndfiym6cgs@box> <20200117173239.GB140922@google.com> <20200117212653.7uftw3lk35oykkmb@box> <20200121181113.GE140922@google.com> <20200122104424.7gvrfivymjvdous4@butterfly.localdomain> <20200123014316.GB249784@google.com> MIME-Version: 1.0 In-Reply-To: <20200123014316.GB249784@google.com> X-MC-Unique: Y5-OHj86ODa6ihavSnUMZQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jan 22, 2020 at 05:43:16PM -0800, Minchan Kim wrote: > > It seems I've overlooked an important piece of this submission: one > > cannot apply the hint to all the anonymous mapping regardless of addres= s > > range. For KSM I'd rather either have a possibility to hint all the > > anonymous mappings, or, as it was suggested previously, be able to iter= ate > > over existing mappings using some (fd-based?) API. >=20 > Thing is how you could identify a certan range is better for KSM than > others from external process? I think the info like this is kinda available via /proc/pid/smaps. It lists the ranges and the vmflags. But using it raises 2 concerns: one is the absence of guarantee the mappings won't change after smaps is read and the second one is that there's no separate vmflag for marking a vma as non-meregable (and IIRC from previous attempts on addressing this, we've already exhausted all the flags on 32-bit arches, so it is not something that can be trivially addressed). --=20 Best regards, Oleksandr Natalenko (post-factum) Senior Software Maintenance Engineer