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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44D73C636CC for ; Mon, 6 Feb 2023 00:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2+PXk8nVx3NPTOETJiS11hyndXZHe78puTDbZrhyWZk=; b=i1U2Wy6Jt4FrPL KEqaDGG4W9Y1SGmOwNM5IQpDGD1iMLo8J3NxvYZL/gCypRWdLUjjGh8hIPBkjDuKzzs7eIBx+6603 SOGmgky8NckYMihdDJPeTgifCx+mDYznyYf2KzZAEZgHWAT2TY5wY/ZYbUErF0BpWeXdIYjsMcKA/ iqeF9VxS17rN07+9ueKMd7Et+0/svaTdmHPAcTPvS/GRIBRRcz4vt50ss+52h3kO0XDPB6Q4ze8qz o5CLVKM2clcGEoRMEhpnATah8UTHguzj6b5Onv20sNOTBdXHq25fgoQ1k8/MnFiIA6qQNHYZY8tPr nDXl3H5WrbhuIwulmdXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOpmO-0075BU-29; Mon, 06 Feb 2023 00:54:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOpmL-0075B0-3X for linux-arm-kernel@lists.infradead.org; Mon, 06 Feb 2023 00:54:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675644878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RtOrxUe6MXUilzi3ALeyX9aNN6+6Dp+de8fvauQCp/I=; b=G9JFiVxPs5q/s63txvl2f4hTfUAGushOMKHV6tcRKGDnjsS7BJqtvpe4McIzCkJR9mIoMo 9jSmlg7LjvKwGferUc1CeMh/QMLBbmkHD4zx3Jf0jGLbIdjYzqp40Qde0CAvCzRMhPgFqa AV8h4UJoixfBqGa7+DmYHGrpTdUhOjQ= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-315-EgjnaO_xNt6oXbxiNAs5jA-1; Sun, 05 Feb 2023 19:54:37 -0500 X-MC-Unique: EgjnaO_xNt6oXbxiNAs5jA-1 Received: by mail-qt1-f198.google.com with SMTP id x16-20020ac87ed0000000b003b82d873b38so5683482qtj.13 for ; Sun, 05 Feb 2023 16:54:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RtOrxUe6MXUilzi3ALeyX9aNN6+6Dp+de8fvauQCp/I=; b=lI4LFBSZbhCVcsnmgjG0BRb1LWM5vZvfcZjwG202liXf3X3RW40gBXCWahveKvI+jg h72B/lSDk9MACXAXIE6df91F1u8rJPw7J4By76MXQ+JRB5JI2xRcjMm65duc1s74yReN ATC2u0PijVIOdJ8bPqd6pnZhHObt33lD9YVb9Pn97selgBSnMelU9669ouHMFWJ41URK V4U3chzdLg+PjDqWNd0G7UhgRxNwRpuDtSPwZq18IPumNDivgEw5iJT/HXFHuobzfY90 3E+ZWJ5ldt1tODCrDjedkCwFHOGPTXv1aftj38KLFyw+GUtrdy3ndsdq21CXhuSWQgia OxTA== X-Gm-Message-State: AO0yUKVVSuDckKL9LSxxLGf6H+xwwa4jF0KK1vcCoZm791n4CXgg5QbN 9tgRcDdG8e2sfWxNf4qqjRSoHlFlb3idNGucd0YBcfIwGR+Uedz5Qi7UhCH6WJB9uA90zV5qrzj 8cLd1zGNwchKfc4B5UXtOf4Uidqe2I4Wp6zY= X-Received: by 2002:ac8:70c6:0:b0:3b8:6d44:ca7e with SMTP id g6-20020ac870c6000000b003b86d44ca7emr30245543qtp.4.1675644877147; Sun, 05 Feb 2023 16:54:37 -0800 (PST) X-Google-Smtp-Source: AK7set/bBn9Wk9zrv600E6sElTcu40EYMTtlJ9J9a7mc/Qqbw8vjmF+ThB3qUAXhFvwAv8oykMT1bA== X-Received: by 2002:ac8:70c6:0:b0:3b8:6d44:ca7e with SMTP id g6-20020ac870c6000000b003b86d44ca7emr30245533qtp.4.1675644876816; Sun, 05 Feb 2023 16:54:36 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id pe4-20020a05620a850400b0071ada51ab48sm6441832qkn.37.2023.02.05.16.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 16:54:36 -0800 (PST) Date: Sun, 5 Feb 2023 19:54:35 -0500 From: Peter Xu To: Matthew Wilcox Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org Subject: Re: [PATCH 0/3] mm/arch: Fix a few collide definition on private use of VM_FAULT_* Message-ID: References: <20230205231704.909536-1-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230205_165441_373212_2D1A8F1B X-CRM114-Status: GOOD ( 30.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 06, 2023 at 12:10:53AM +0000, Matthew Wilcox wrote: > On Sun, Feb 05, 2023 at 06:17:01PM -0500, Peter Xu wrote: > > I noticed a few collision usage on VM_FAULT_* definition in the page fault > > path on arm/arm64/s390 where the VM_FAULT_* can overlap with the generic > > definition of vm_fault_reason. > > > > The major overlapped part being VM_FAULT_HINDEX_MASK which is used only by > > the hugetlb hwpoisoning. > > > > I'm not sure whether any of them can have a real impact, but that does not > > look like to be expected. I didn't copy stable, if anyone thinks it should > > please shoot. Nor did I test them in any form - I just changed the > > allocations from top bits and added a comment for each of them. > > This seems like a bad way to do it. Why not just put these VM_FAULT_* > definitions in linux/mm_types.h? Then we'll see them when adding new > VM_FAULT codes. Sure, they won't be used by every architecture, but > so what? My initial version actually contains a few VM_FAULT_PRIVATE_N there, but I noticed only the minority uses that, especially there's s390 which takes 5 entries. I didn't had my mind straight on which's the best to go, then I removed them and posted this simpler version, with comment on each to fix the issues, more in a sense of raising the problem first. I agree it isn't a problem at all, not until 32 bits all used up. But that seems to slightly encourage more archs from using the new private entries which I wanted to avoid. If to take a closer look, we may not really need that much private entries. With s390, what I read is: - VM_FAULT_BADMAP could be replaced directly with VM_FAULT_SIGSEGV? - VM_FAULT_PFAULT could be replaced directly with VM_FAULT_BADCONTEXT? Then if I'm not wrong we can already reduce 5->3 private entries. I didn't directly change that because I am not 100% confident and I can't test them myself. It'll be great if arch people can have a look at either s390 and arm to see whether there's chance of simplifcations first. So the patchset is more of raising the collision issue first, meanwhile great to attract attention for arch people to refactor upon it. I can also try to reduce the private entries and introduce PRIVATE entries accordingly as you suggested, but I'll need more help on reviews and tests than this one. Thanks, -- Peter Xu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel