From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id B72F16B0006 for ; Tue, 13 Nov 2018 17:53:38 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id h68so34173339qke.3 for ; Tue, 13 Nov 2018 14:53:38 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p6sor23216790qtc.0.2018.11.13.14.53.37 for (Google Transport Security); Tue, 13 Nov 2018 14:53:37 -0800 (PST) Date: Tue, 13 Nov 2018 22:53:34 +0000 From: Pavel Tatashin Subject: Re: [PATCH V3] KSM: allow dedup all tasks memory Message-ID: <20181113225334.hnz7pqoldvvg6j3w@soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net> References: <20181113175930.3g65rlhbaimstq7g@soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net> <20181113183510.5y2hzruoi23e7o2t@soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net> <20181113191653.btbzobquxtwt47z4@soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Timofey Titovets Cc: Oleksandr Natalenko , Jann Horn , linux-doc@vger.kernel.org, Linux Kernel , linux-mm@kvack.org, Matthew Wilcox > > > That must work, but we out of bit space in vm_flags [1]. > > > i.e. first 32 bits already defined, and other only accessible only on > > > 64-bit machines. > > > > So, grow vm_flags_t to 64-bit, or enable this feature on 64-bit only. > > With all due respect to you, for that type of things we need > mm maintainer opinion. As far as I understood, you already got directions from the maintainers to do similar to the way THP is implemented, and THP uses two flags: VM_HUGEPAGE VM_NOHUGEPAGE, the same as I am thinking ksm should do if we honor MADV_UNMERGEABLE. When VM_NOHUGEPAGE is set khugepaged ignores those VMAs. There may be a way to add VM_UNMERGEABLE without extending the size of vm_flags, but that would be a good start point in looking how to add a new flag. Again, you could simply enable this feature on 64-bit only. Pasha