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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57E35CE79A5 for ; Mon, 25 Sep 2023 22:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231653AbjIYWLW (ORCPT ); Mon, 25 Sep 2023 18:11:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjIYWLU (ORCPT ); Mon, 25 Sep 2023 18:11:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB79F107 for ; Mon, 25 Sep 2023 15:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=m41YmgAlvlgZpwnL0qQM2KGCyZY6OCsIZ8O/irEMgBQ=; b=Y2Qe941jWJAfvz+rqON69Ejd3S nLm4c1FZo4i8LCQsjNv2joK9WKgWwsq5Gg3U8NWj3v1LEfIuIMXx2NVn93U6x5AtV50vCV7g9is20 5KjEQMpQ30BlC8eq1aCEivbzfAqNkI6YI/CEPvINIWcPylWmmUaqBo6pK0ACjVDxHGmx2o0ayiFl8 h49RqPmSICN+0uaOmOWiBzHiYO6OdrLZbc7RdcIPOd/oovJexnkm/zzpQcZN+Ou1Vq3hyJ69gFjS/ 1o50v9U7S9XRu8t8lQVjctB4xmlfWsu3u7NSgt/WYxdhnyYUhSfrGtv4zoE2YQAvFfKhQvw5HZ+R2 SVEtLn8w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qktmy-003xxD-Dd; Mon, 25 Sep 2023 22:10:48 +0000 Date: Mon, 25 Sep 2023 23:10:48 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , Andi Kleen , Christoph Lameter , Mike Kravetz , David Hildenbrand , Suren Baghdasaryan , Yang Shi , Sidhartha Kumar , Vishal Moola , Kefeng Wang , Greg Kroah-Hartman , Tejun Heo , Mel Gorman , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 02/12] kernfs: drop shared NUMA mempolicy hooks Message-ID: References: <2d872cef-7787-a7ca-10e-9d45a64c80b4@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 25, 2023 at 01:22:27AM -0700, Hugh Dickins wrote: > It seems strange that kernfs should be an outlier with a set_policy and > get_policy in its kernfs_vm_ops. Ah, it dates back to v2.6.30's commit > 095160aee954 ("sysfs: fix some bin_vm_ops errors"), when I had crashed > on powerpc's pci_mmap_legacy_page_range() fallback to shmem_zero_setup(). > > Well, that was commendably thorough, to give sysfs-bin a set_policy and > get_policy, just to avoid the way it was coded resulting in EINVAL from > mmap when CONFIG_NUMA; but somehow feels a bit over-the-top to me now. > > It's easier to say that nobody should expect to manage a shmem object's > shared NUMA mempolicy via some kernfs backdoor to that object: delete > that code (and there's no longer an EINVAL from mmap in the NUMA case). > > This then leaves set_policy/get_policy as implemented only by shmem - > though importantly also by SysV SHM, which has to interface with shmem > which implements them, and with SHM_HUGETLB which does not. > > Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle)