Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp803033ybm; Tue, 21 May 2019 03:55:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzyD2rmOcTN4wS2meinuBp8aGyY4v3bx3XszMBYPs2ocr5e6m/N3Ap4k+WwQijtB9Y4ato X-Received: by 2002:a63:d615:: with SMTP id q21mr80128441pgg.401.1558436157431; Tue, 21 May 2019 03:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558436157; cv=none; d=google.com; s=arc-20160816; b=DO6pG/IEdnSJlp2VfwS5x7vrk0yUchRqkxz0/uLfPVNTX7UTY9OdKwEy8oZ6jONrnP sfEmtdtvMNLaUNpW2WvPvsPOMqqJldn7bkoL9e9i7Dk4WoeC+B+HiGTU2heU80y5Su1N 2/7v/oENjEk04iYKlDLWESTmeLs/wU/NjK6wUHbi1w+JSI2/VZTOZFpvzvMG95ehhlGd qhBXmgj/2o/wG7rdqPYPTyPPxwWAUNyoRjiZoE+KNsh1sViNHpcI6WqXqNW6fNGGwqqa BPygXoXgWzDHG8S6FRi/YZm+C9LuIRBNQn+CobTGF0Cop3x6tvr0q/nTZb0RXsijJVzy dzgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2Sic2O7wb52L5CR9NZn4I8czhdSoXaChDb/juZvSzjk=; b=OsD0fzHeV5m5SWw0XFy38SttgC/lIHlU3RPbBkzJg6PnoLpxcnLI7cJum52SC4x6x2 U++9hSXEFS3wGK4bsnhfmPtQjDjqTwWlPDTqLUUPCGPyplg8GCviYA+05Gi/KW9sLdSI cXm+FT9uveKLPzXu70u3hWxPrfZCGbPLKQbGziCpmMwOxJOOCUHWrPaCTT5IIXU46XVf QKx+xV3NXHYEDMMaPm08QQ/N0zZlxQXwDAuKDD7Q8h2LE3yH+5Cy1Uv/1Ar3rZiF/fpW 2+gbwG5bcv/7w2/lB42VzXw3DX6piAckF1KHCsIz3V9P7Eo2MfFQGTun/b9ECrzjAlss HnKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kqar2URp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e64si21887569pfe.178.2019.05.21.03.55.42; Tue, 21 May 2019 03:55:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kqar2URp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbfEUKxD (ORCPT + 99 others); Tue, 21 May 2019 06:53:03 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46627 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbfEUKxD (ORCPT ); Tue, 21 May 2019 06:53:03 -0400 Received: by mail-pf1-f193.google.com with SMTP id y11so8860033pfm.13 for ; Tue, 21 May 2019 03:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2Sic2O7wb52L5CR9NZn4I8czhdSoXaChDb/juZvSzjk=; b=kqar2URpzHjwHZxhz9FhJySyjNcvp48Yvzwkmxf2VubqeURESj6Vff0i/jsIthS7y9 fPRjulw8tqg5W/oB23bfQ6UFnd8nscb2aa5s8AAzR6x2gUQbSsbmCcBbB7K1Uh/hzbiv ZeoxCNKSzYQ80A1lxxKgGkbjkN61+GLe0vQUUtixqAl/tDRPbShOiB0e1oWE/ejNmBFv dqBUvs9CRSKIAN4+yxm1aYazKW+oNgGlzkPpuhdWb4Z3w7wGKiYDfQlj3WlYFi/as9VJ VFMSyRQc0lXkd32xUqS1qV7HC6vxnJFGeLEI1qV1TDkfxSHCiLUZ0ohK/bMC56iKFykQ 9XTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=2Sic2O7wb52L5CR9NZn4I8czhdSoXaChDb/juZvSzjk=; b=JMfnlsuXu8JIfhQJG9u8+YXWZMO2sSOMRNHzdbhtbgl3foV+FHe+Co61lgM1Wkdkj5 MTcS6KGGUhvx7EzSpyhU2+YUWLrHXDoeTg3YqlJhUBQXfv7HGCMca5+k1oZmMX1GQbaT r9PJKe2voPG638Ey5ECcvrXRrrzFu40wK4WhC0pRx/0SVle+u/eE8eYPPvNijtcPuAuy vH8OfMPFaQBulr89qTms5ictAZOAdXuKml/exb0c/vNhNpvO40HIMYiABBZu7ZcABFFC +iT+7dOPdRfmfHx4qCel3RpHO18R5leHIf3slqFrFg/ToInZWXLLwFh4FE7J2DOjxRVG Yohw== X-Gm-Message-State: APjAAAVFjTynL2lGRMXVM8OPpzEj4x2FxYWPSWSecSa+Uh7cCsr2W0sm ax07f4ivYMlmjo5xAbUFB7w= X-Received: by 2002:a63:ba5a:: with SMTP id l26mr80865856pgu.183.1558435982668; Tue, 21 May 2019 03:53:02 -0700 (PDT) Received: from google.com ([2401:fa00:d:0:98f1:8b3d:1f37:3e8]) by smtp.gmail.com with ESMTPSA id j64sm37602676pfb.126.2019.05.21.03.52.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 21 May 2019 03:53:01 -0700 (PDT) Date: Tue, 21 May 2019 19:52:56 +0900 From: Minchan Kim To: Oleksandr Natalenko Cc: Michal Hocko , Andrew Morton , LKML , linux-mm , Johannes Weiner , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Daniel Colascione , Shakeel Butt , Sonny Rao , Brian Geffon Subject: Re: [RFC 4/7] mm: factor out madvise's core functionality Message-ID: <20190521105256.GF219653@google.com> References: <20190520035254.57579-1-minchan@kernel.org> <20190520035254.57579-5-minchan@kernel.org> <20190520142633.x5d27gk454qruc4o@butterfly.localdomain> <20190521012649.GE10039@google.com> <20190521063628.x2npirvs75jxjilx@butterfly.localdomain> <20190521065000.GH32329@dhcp22.suse.cz> <20190521070638.yhn3w4lpohwcqbl3@butterfly.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521070638.yhn3w4lpohwcqbl3@butterfly.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 09:06:38AM +0200, Oleksandr Natalenko wrote: > Hi. > > On Tue, May 21, 2019 at 08:50:00AM +0200, Michal Hocko wrote: > > On Tue 21-05-19 08:36:28, Oleksandr Natalenko wrote: > > [...] > > > Regarding restricting the hints, I'm definitely interested in having > > > remote MADV_MERGEABLE/MADV_UNMERGEABLE. But, OTOH, doing it via remote > > > madvise() introduces another issue with traversing remote VMAs reliably. > > > IIUC, one can do this via userspace by parsing [s]maps file only, which > > > is not very consistent, and once some range is parsed, and then it is > > > immediately gone, a wrong hint will be sent. > > > > > > Isn't this a problem we should worry about? > > > > See http://lkml.kernel.org/r/20190520091829.GY6836@dhcp22.suse.cz > > Oh, thanks for the pointer. > > Indeed, for my specific task with remote KSM I'd go with map_files > instead. This doesn't solve the task completely in case of traversal > through all the VMAs in one pass, but makes it easier comparing to a > remote syscall. I'm wondering how map_files can solve your concern exactly if you have a concern about the race of vma unmap/remap even there are anonymous vma which map_files doesn't support. > > -- > Best regards, > Oleksandr Natalenko (post-factum) > Senior Software Maintenance Engineer