From: Dave Hansen Subject: Re: [PATCH v12 02/11] mm, swap: Add infrastructure for saving page metadata on swap Date: Mon, 5 Mar 2018 11:20:09 -0800 Message-ID: <0d77dc3c-1454-a689-a0fb-f07e8973c29e@linux.intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Khalid Aziz , akpm@linux-foundation.org, davem@davemloft.net, arnd@arndb.de Cc: kirill.shutemov@linux.intel.com, mhocko@suse.com, ross.zwisler@linux.intel.com, dave.jiang@intel.com, mgorman@techsingularity.net, willy@infradead.org, hughd@google.com, minchan@kernel.org, hannes@cmpxchg.org, shli@fb.com, mingo@kernel.org, jglisse@redhat.com, me@tobin.cc, anthony.yznaga@oracle.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, sparclinux@vger.kernel.org, Khalid Aziz List-Id: linux-arch.vger.kernel.org On 02/21/2018 09:15 AM, Khalid Aziz wrote: > If a processor supports special metadata for a page, for example ADI > version tags on SPARC M7, this metadata must be saved when the page is > swapped out. The same metadata must be restored when the page is swapped > back in. This patch adds two new architecture specific functions - > arch_do_swap_page() to be called when a page is swapped in, and > arch_unmap_one() to be called when a page is being unmapped for swap > out. These architecture hooks allow page metadata to be saved if the > architecture supports it. I still think silently squishing cacheline-level hardware data into page-level software data structures is dangerous. But, you seem rather determined to do it this way. I don't think this will _hurt_ anyone else, though other than needlessly cluttering up the code.