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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 864C9C433F5 for ; Thu, 17 Feb 2022 04:55:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94B2F6B0074; Wed, 16 Feb 2022 23:55:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D3AE6B0075; Wed, 16 Feb 2022 23:55:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74C706B0078; Wed, 16 Feb 2022 23:55:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 61F676B0074 for ; Wed, 16 Feb 2022 23:55:07 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 14705180C3C55 for ; Thu, 17 Feb 2022 04:55:07 +0000 (UTC) X-FDA: 79151057454.19.9D344E7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 896D7A0006 for ; Thu, 17 Feb 2022 04:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645073706; 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=RMv0nYd6lGK+0myXiREIWX1spcR5nFtehllxBFTPu1Y=; b=ffx0aL2DMQ/sOBmuC+mhThf6r7EOAbvnIwvZ+J4rAyjPZ2Vg6mBXoAra+KxHtbFLctvYh1 popFGxhi/W/lri+LoKXG3VEzOax+J5qa3oAxcTpieGWkUDgJy97z8TIUsr56ageP5z70qh 1ek5lNLO0InrhPtIXizLE8RNo/3MTeI= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-LKN0GCmhMaC3LhVsG9q52A-1; Wed, 16 Feb 2022 23:55:04 -0500 X-MC-Unique: LKN0GCmhMaC3LhVsG9q52A-1 Received: by mail-pj1-f72.google.com with SMTP id t16-20020a17090b019000b001b8af627800so5735659pjs.8 for ; Wed, 16 Feb 2022 20:55:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RMv0nYd6lGK+0myXiREIWX1spcR5nFtehllxBFTPu1Y=; b=kpyg/TMwUftdDz/skV/RLJHZgll3lIZxkQh0FLvsF68usUx/endZkhq4TlGSj/HQ0Q ckMuhcRiv0Y6dxiXWkRJSG8aVVkq00JDyXrbeJDZitUIeBloPMyZvWrvRu5Jou00N5Au r0JsH+XsjwQz4t6VfqBlDmZNwYa7Wt08BOGbRhy5V1VvtdmcFjtPss+u4MJi/jgcH9Pn jDvOUB9UXscXcKcSRA9KnZ2NiXPz7CYSqTE+FTD5/T/Jbnl+sOuyDCYfihsa2rR5qVOa Qd1Gim3FOtzT5vpHPWRNXULMsLd9PqzE1pJdyUyUsjV6GXl481yhbXFI3qaZnd2drlvy 5Fog== X-Gm-Message-State: AOAM531NFdcDGCuLSGmZ7BLBodxKLVip5EckTTb4Tl7/6N7jDDMX583P v8nDCe4kRMHvMhB2hbrwPw5zwtvnvw+MsIYnxk2BBs5KKi0ExmG461uMnlubbAqZS0HEzH8iwuq DHHLrX4PBOGg= X-Received: by 2002:a63:64c5:0:b0:34d:3d6c:31d2 with SMTP id y188-20020a6364c5000000b0034d3d6c31d2mr1058960pgb.499.1645073703668; Wed, 16 Feb 2022 20:55:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWkBcDi1skevakW2rDEWyLhv5w6//N3woI9hMgQrmqsdqWPUoZgA2KY0t4hPceD8oDm7tX7Q== X-Received: by 2002:a63:64c5:0:b0:34d:3d6c:31d2 with SMTP id y188-20020a6364c5000000b0034d3d6c31d2mr1058930pgb.499.1645073703415; Wed, 16 Feb 2022 20:55:03 -0800 (PST) Received: from xz-m1.local ([94.177.118.126]) by smtp.gmail.com with ESMTPSA id j15sm48731086pfj.102.2022.02.16.20.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 20:55:02 -0800 (PST) Date: Thu, 17 Feb 2022 12:54:54 +0800 From: Peter Xu To: John Hubbard Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , "Kirill A . Shutemov" , Matthew Wilcox , Yang Shi , Andrea Arcangeli , Alistair Popple , David Hildenbrand , Vlastimil Babka , Hugh Dickins Subject: Re: [PATCH v4 4/4] mm: Rework swap handling of zap_pte_range Message-ID: References: <20220216094810.60572-1-peterx@redhat.com> <20220216094810.60572-5-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ffx0aL2D; spf=none (imf15.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam07 X-Rspam-User: X-Rspamd-Queue-Id: 896D7A0006 X-Stat-Signature: zphw35d8unxbbxguz5sxaj1x73nffp1g X-HE-Tag: 1645073706-839534 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Feb 16, 2022 at 07:25:14PM -0800, John Hubbard wrote: > On 2/16/22 1:48 AM, Peter Xu wrote: > > Clean the code up by merging the device private/exclusive swap entry handling > > with the rest, then we merge the pte clear operation too. > > Maybe also mention that you reduced the code duplication in the > is_device_private_entry() area, by letting it fall through to the common > pte_clear_not_present_full() at the end of the loop? Since you're listing > the other changes, that one seems worth mentioning. Isn't that the "we merge the pte clear operation" part? :) I can add another sentence to it, if it looks better to you: ---8<--- Clean the code up by merging the device private/exclusive swap entry handling with the rest, then we merge the pte clear operation too. We do it by letting the private/exclusive block fall through to the last call to pte_clear_not_present_full(). ---8<--- Thanks for the review, -- Peter Xu