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 32766C04A95 for ; Tue, 25 Oct 2022 15:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233282AbiJYPb7 (ORCPT ); Tue, 25 Oct 2022 11:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233259AbiJYPbu (ORCPT ); Tue, 25 Oct 2022 11:31:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E6B48E7BF for ; Tue, 25 Oct 2022 08:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666711908; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8ubJrAQo+otL1AZ9Abp0aYcF9mVXIW+a9k2CYvh8qVg=; b=GdjZ5+8DrNps+5w/7BlTWNtCZIimHRzNOeW0Qu+yfcJuJWS/IN8JtVb057fzFtsl5nr/wM kJrHszyvAlI5YUS3zvCtlTKNmurnLZs8N3fant2acir+XMx0MsIb006GNlkh0Ih7a2gNTy 8GYThJlOnag32EGC3e7kHwmcSlFpxeo= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-256--0EKhtzMMjOn7TNqiNOQhQ-1; Tue, 25 Oct 2022 11:31:47 -0400 X-MC-Unique: -0EKhtzMMjOn7TNqiNOQhQ-1 Received: by mail-wr1-f72.google.com with SMTP id c18-20020adfa312000000b002364fabf2ceso4883343wrb.2 for ; Tue, 25 Oct 2022 08:31:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8ubJrAQo+otL1AZ9Abp0aYcF9mVXIW+a9k2CYvh8qVg=; b=f20elhbA1gBmyefDVouHd6+UBeJw0kGk+9ryzhibQa0TTJ0qi6n1Eur5ItmlrI67z3 5hxis3NElR86KFDwZX4Wjdm1P8rHeuKizLdaDufSGnj9UDLvg5rIOnKgMd888rQW30i8 nX06YkO7qsSNN/eHoRUgN/3Kyv+HQYrMxNFT6rerv4ebfRaVa6rXXmUb7XJJAe97GeRS Ug5qamsW2j36fW1DOz4jGW/akW7g6i9xhu0ZK4pXDd42YNPVswf2SZAjY+gswvxe5aP3 O71SioHMu/u2DYEhnyLtuoEIYX42ti8B8wZZbqcKNYeYou5b/2SjGw/Zh13v7pVpuhm5 Wvmg== X-Gm-Message-State: ACrzQf0wtxdhKqqtMS5+L8fEwq0POOh9alXeYC3GLbW0hH615uBh00QB hip2RMyA7U8/VP680Dhg5pYZtP6xS9p9S+YZnkXZ7XvWEewIgH7woyEwbQAowlYHNvOBCZkELlF 5iIE8KyZ98M4MZW1aQ5Ed2k7O X-Received: by 2002:a05:600c:34cc:b0:3c6:fb65:24cc with SMTP id d12-20020a05600c34cc00b003c6fb6524ccmr27060406wmq.1.1666711905944; Tue, 25 Oct 2022 08:31:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4iTnlvYMQ4F2npklHfv1Ot93I/zcEUEDxI5AjUuriPL7zR9mOccMdvYem7JpMzTWpxt3ybFQ== X-Received: by 2002:a05:600c:34cc:b0:3c6:fb65:24cc with SMTP id d12-20020a05600c34cc00b003c6fb6524ccmr27060382wmq.1.1666711905674; Tue, 25 Oct 2022 08:31:45 -0700 (PDT) Received: from ?IPV6:2003:cb:c719:d00:eae9:3af6:9999:7b63? (p200300cbc7190d00eae93af699997b63.dip0.t-ipconnect.de. [2003:cb:c719:d00:eae9:3af6:9999:7b63]) by smtp.gmail.com with ESMTPSA id k11-20020a056000004b00b0023657e1b97esm2972074wrx.11.2022.10.25.08.31.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Oct 2022 08:31:45 -0700 (PDT) Message-ID: Date: Tue, 25 Oct 2022 17:31:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH RFC 2/2] mm: Use pte markers for swap errors Content-Language: en-US To: Peter Xu , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Huang Ying , Andrew Morton , HORIGUCHI NAOYA , Miaohe Lin , Andrea Arcangeli References: <20221024204830.1342169-1-peterx@redhat.com> <20221024204830.1342169-3-peterx@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20221024204830.1342169-3-peterx@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.10.22 22:48, Peter Xu wrote: > PTE markers are ideal mechanism for things like SWP_SWAPIN_ERROR. Using a > whole swap entry type for this purpose can be an overkill, especially if we > already have PTE markers. Define a new bit for swapin error and replace it > with pte markers. Then we can safely drop SWP_SWAPIN_ERROR and give one > device slot back to swap. > > We used to have SWP_SWAPIN_ERROR taking the page pfn as part of the swap > entry, but it's never used. Neither do I see how it can be useful because > normally the swapin failure should not be caused by a bad page but bad swap > device. Drop it alongside. [...] > > -#define PTE_MARKER_UFFD_WP BIT(0) > -#define PTE_MARKER_MASK (PTE_MARKER_UFFD_WP) > +#define PTE_MARKER_UFFD_WP BIT(0) > +#define PTE_MARKER_SWAP_ERROR BIT(1) I'd suggest to keep the term SWAPIN. An error happened during swapin, which is why the page is corrupted. (I remember that we discussed naming details in the original series and SWAPIN was the conclusion) -- Thanks, David / dhildenb