Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2822216ybc; Wed, 20 Nov 2019 21:59:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwYrmwiqD1gQXTCtTbXh5HRLLZfnX9Idmqw5b1pHhK7V3BhId5Ikt24pIsmS9eM12t4oEkh X-Received: by 2002:a17:906:e297:: with SMTP id gg23mr11515483ejb.41.1574315962174; Wed, 20 Nov 2019 21:59:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574315962; cv=none; d=google.com; s=arc-20160816; b=eydZbpLPYXXAW+YJ5JvXhVhw5H1ekso+tCoI5cMWBFR5RIu0AsfsifrGUTW93xK2Ze Kq8LjBeMYVEC/b/je4NB3A20r7/08L8fs+3C1b1egNk31dbNhbSVABetEuVGt6O780L5 2t9USRYGzYphHit0EbQXYrGD4Qyyas49k9Uhj5C6rZ2bmAtDd3zX3AvYkMdsw2bvYHyk bDitZtD2KDl5RfCEQ48+fXdtNWe8wLW0cPh3qOsx64b8VTOGzo2EnxX0gwdpGLPe+IUU Vfw+IMaKa8ml9JkFr9tJh5LWC+w7hglbBuf08S9AKJbYeVTDio3jO0P3c7u/FNtW3b+N G2rw== 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=dkWuzJhFxsap/bBn2x3w9fV4hC7gHwnEGs4GgvrBBhY=; b=ME7v5TZ2otpZLEPPgDK/+mBomEFVlNL0GpGuo630HxCc/f2YEQSbveRNTGSUPdrckW gCPcI3907LUFpCZ0tc1uwyHRCoHcZnDjKmabxqOxWWIDim2NffoyGDSmVmTRT667Mvg3 tGzgsAe/YzpgD9EA+0k9m23mAkfozOJVumBWn3n/QvA1b1/7m5Cbz7B4DMZHoJZJIVPK 4TvP/EDK34J8juWnhCqs9hOPLxSPm8kc/RXqoDJoDgMe4ugvXgYQEfLtGVxQDmw5lP9h dGaQKiVFfI4/3cwuwtuxnl6/r9eKN+sGRTOikoL5xI59+hHS+B3Ug9BGn3/9ppEzvagO JICw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mYdeGcMZ; 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 i19si1631416edt.189.2019.11.20.21.58.58; Wed, 20 Nov 2019 21:59:22 -0800 (PST) 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=mYdeGcMZ; 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 S1726529AbfKUF5a (ORCPT + 99 others); Thu, 21 Nov 2019 00:57:30 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35277 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfKUF5a (ORCPT ); Thu, 21 Nov 2019 00:57:30 -0500 Received: by mail-wm1-f66.google.com with SMTP id 8so2313749wmo.0 for ; Wed, 20 Nov 2019 21:57:28 -0800 (PST) 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=dkWuzJhFxsap/bBn2x3w9fV4hC7gHwnEGs4GgvrBBhY=; b=mYdeGcMZBOk1xCoELA4GJrpa93t+ES8qiGwicihqG3mkodMwQRYHR0wwdgFcjWNguY sqD/0rwxN3n2uLcr/IxihJ2PDrYBZ41Ix/I4RFxGz07FF4iSTNM3UqUQyjCqdA0FVU5i dshR2z3SufdDSG7vpLELHY7Ib+E0M5k67HZG23kqbgRXQIpvLjJAcfihGb2CRger/ioT AmJzYRl1ySktpHsP5TsNLMeLIeN74FRUkvJ6l9zhaZVvZZMevRtB22s/ASrlTPeJh+ov 79Mju2BLFuVS81lgFk5LH2lBxU5v0gm9GCostjkCPuXn++uT0o3R18FI/i5e4Xqcs6Wh 0sUg== 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=dkWuzJhFxsap/bBn2x3w9fV4hC7gHwnEGs4GgvrBBhY=; b=m91eUnKuOAlw6895g7oGTRRDPz6skEWv4z4cIHO8BoCHtPubdgmxhg71Z4nZ94T+/D 5tABn7bwmm0CZuZwYnhXgGnlGn9h7mts+mbZl9L2HBtVsLVxsGRhUHAe5QD11K8RlVc3 TKIjsmZLXjgPl02yrycdcchuxiHLRH2nVAf73rC9vqa3vIAwoXxdesUYvQ5LEFGU4yuR /Acs9sjiqnVyBVhSU/+rH7+FwSmL6jHd4En2ZRnWRSErz+AzM0HMOh4TX7kSKiqJ9Vaw W5ovdoZsb41QonodSzD+R3Wl9Vjews8wsalpV7Bxh31EWqzIhFt/7byM7FajKrXc8teS 2f1A== X-Gm-Message-State: APjAAAXgNdkc93hNpDCoBNioknckM0IxjjSOuifE5QTKIPW0p/bORuWE hH1/WJATGmfU0/XAqg102g4= X-Received: by 2002:a1c:6588:: with SMTP id z130mr7075478wmb.87.1574315847558; Wed, 20 Nov 2019 21:57:27 -0800 (PST) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id y78sm1782525wmd.32.2019.11.20.21.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 21:57:26 -0800 (PST) Date: Thu, 21 Nov 2019 06:57:24 +0100 From: Ingo Molnar To: Davidlohr Bueso Cc: tglx@linutronix.de, bp@alien8.de, peterz@infradead.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -tip v3 0/4] x86,mm/pat: Move towards using generic interval tree Message-ID: <20191121055724.GA38182@gmail.com> References: <20191121011601.20611-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121011601.20611-1-dave@stgolabs.net> 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 * Davidlohr Bueso wrote: > Changes from v2: > - Removed unnecessary goto error path in patch 1, per tglx. > - Added the corresponding Makefile change for patch 4, per mingo. > - Added tglx's review tags. > > Changes from v1[0]: > - Got rid of more code in patch 1 by using the end - 1 for closed > intervals, instead of keeping the overlap-check. > > - added an additional cleanup patch. > > Hi, > > I'm sending this series again in this format as the interval tree > node conversion will, at a minimum, take longer than hoped for > (ie: Jason still removing interval tree users for the mmu_notifier > rework[1]). There is also a chance this will never see be done. > > As such, I'm resending this series (where patch 1 is the only > interesting one and which Ingo acked previously, with the exception > that the nodes remain fully closed). In the future, it would be > trivial to port pat tree to semi open nodes, but for now think that > it makes sense to just get the pat changes in. > > Please consider for v5.5. Thanks! > > [0] https://lore.kernel.org/lkml/20190813224620.31005-1-dave@stgolabs.net/ > [1] https://marc.info/?l=linux-mm&m=157116340411211 > > Davidlohr Bueso (4): > x86/mm, pat: Convert pat tree to generic interval tree > x86/mm, pat: Cleanup some of the local memtype_rb_* calls > x86/mm, pat: Drop rbt prefix from external memtype calls > x86/mm, pat: Rename pat_rbtree.c to pat_interval.c > > arch/x86/mm/Makefile | 2 +- > arch/x86/mm/pat.c | 8 +- > arch/x86/mm/pat_internal.h | 20 ++-- > arch/x86/mm/pat_interval.c | 185 +++++++++++++++++++++++++++++++ > arch/x86/mm/pat_rbtree.c | 268 --------------------------------------------- > 5 files changed, 200 insertions(+), 283 deletions(-) > create mode 100644 arch/x86/mm/pat_interval.c > delete mode 100644 arch/x86/mm/pat_rbtree.c Thanks Davidlohr - this is a really nice cleanup of the logic and of the tree data structure, and I've applied your earlier series to tip:WIP.x86/mm already, with a few more work-in-progress patches from me on top that tidy up this area of the code. In particular I've done a bunch of changes to improve the hackability of all pat/memtype/set_memory facilities, we've now got , memtype.[ch], memtype_interval.c and set_memory.c in arch/x86/mm/pat/: dagon:~/tip> ls -l arch/x86/mm/pat/ total 112 -rw-r--r-- 1 mingo mingo 5782 Nov 21 06:41 cpa-test.c -rw-r--r-- 1 mingo mingo 117 Nov 21 06:41 Makefile -rw-r--r-- 1 mingo mingo 32026 Nov 21 06:41 memtype.c -rw-r--r-- 1 mingo mingo 1470 Nov 21 06:41 memtype.h -rw-r--r-- 1 mingo mingo 5003 Nov 21 06:41 memtype_interval.c -rw-r--r-- 1 mingo mingo 56668 Nov 21 06:41 set_memory.c ( Note: cpa-test.c should probable be renamed to set_memory_test.c, with a few explicit set_memory() API tests added as well, not just the internal change_page_attribute() tests. Will do this later. ) The memtype APIs are (rightside column): reserve_memtype() => memtype_reserve() free_memtype() => memtype_free() kernel_map_sync_memtype() => memtype_kernel_map_sync() io_reserve_memtype() => memtype_reserve_io() io_free_memtype() => memtype_free_io() memtype_check_insert() => memtype_check_insert() memtype_erase() => memtype_erase() memtype_lookup() => memtype_lookup() memtype_copy_nth_element() => memtype_copy_nth_element() But there's a lot more changes: 218bf1a8c73b: x86/mm/pat: Convert the PAT tree to a generic interval tree 3309be371c20: x86/mm/pat: Clean up some of the local memtype_rb_*() calls b40805c214c5: x86/mm/pat: Drop the rbt_ prefix from external memtype function names ee4e7b04b718: x86/mm/pat: Rename pat_rbtree.c to pat_interval.c 8afed68b3426: x86/mm/pat: Update the comments in pat.c and pat_interval.c and refresh the code a bit bc8a3eed1241: x86/mm/pat: Disambiguate PAT-disabled boot messages 10ffd914266a: x86/mm/pat: Create fixed width output in /sys/kernel/debug/x86/pat_memtype_list, similar to the E820 debug printouts 37dfd5d60000: x86/mm/pat: Simplify the free_memtype() control flow b686cd38771d: x86/mm/pat: Harmonize 'struct memtype *' local variable and function parameter use 7fa6ebcdfb73: x86/mm/pat: Clean up PAT initialization flags a224f826be60: x86/mm/pat: Move the memtype related files to arch/x86/mm/pat/ acb2f580640a: x86/mm/pat: Standardize on memtype_*() prefix for APIs 393cac16e6b7: x86/mm/pat: Rename => 22a6d30c44c7: x86/mm/pat: Clean up externs 56ca0be07c28: x86/mm/pat: Fix typo in the Kconfig help text 07fbea7b3be2: x86/mm: Tabulate the page table encoding definitions I'll send them out separately as well once completed, but wanted to give you a heads-up. My patches are in WIP state because neither the changelogs nor the split-up is necessarily final. These can all be accessed and followed under: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/mm What do you think about these changes? Anything else you'd like to see happen? In terms of upstreaming plans, the 4 commits from you I grouped separately definitely look like v5.5 material to me - will merge them into tip:x86/mm later today. Thanks, Ingo