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 859E2C4167E for ; Thu, 14 Apr 2022 14:21:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D6C526B0071; Thu, 14 Apr 2022 10:21:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1BBF6B0073; Thu, 14 Apr 2022 10:21:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE2746B0074; Thu, 14 Apr 2022 10:21:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id B18426B0071 for ; Thu, 14 Apr 2022 10:21:45 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8455222E12 for ; Thu, 14 Apr 2022 14:21:45 +0000 (UTC) X-FDA: 79355698170.03.1276D66 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id C2E4040008 for ; Thu, 14 Apr 2022 14:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649946104; 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=lys9OvSbD/kPAhkzPWHuJKcH+xiG4FQId/LRShqL04Y=; b=aAoiDUkKdLtsOnhFyAijZKhQpGPerT9pLQQuvDxNmYonz8x7occdS7pHLsi2fWn+DEIYBQ Hp+Shmscb0JJKzkisvjELZa4Vgc+BqBTvo83xeA8OoFRpBu0ZWhKv8cipf54RQVHUOEa5j ixTliWBzceX2VChclrfp4TCwiWHToLY= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-519-0PibkL2fO4qCAYOaN8yvaQ-1; Thu, 14 Apr 2022 10:21:43 -0400 X-MC-Unique: 0PibkL2fO4qCAYOaN8yvaQ-1 Received: by mail-il1-f197.google.com with SMTP id m3-20020a056e02158300b002b6e3d1f97cso3067292ilu.19 for ; Thu, 14 Apr 2022 07:21:43 -0700 (PDT) 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=lys9OvSbD/kPAhkzPWHuJKcH+xiG4FQId/LRShqL04Y=; b=JD7s+S26LUokYY+vd2TNTsF3SGgjXvyaRr3/6NARUFh8ZFok4NQ7F7XCmPj0g1bFMn FId37ZuSSwySRV2DWI8/6j3f4Cu604twdCw7pdjkrNd7xhFLXvgfKkcpyTYEKOR6bCFt NEaPC57r3+NS1zLPXjGs6u6qIGi7Rp3J5psxOEFEPIz6yPHtUwwOOCDZMWJ+KHsMoOMZ sf+9wqks9mFqCdi0U8QotEjh1pVd3rh62QBfA6X9i5tiMwP+AWzb/MyGcHCO7pZMHcjQ dj1D1mXkduQQSaYclcFoD7qo41p160n86XdKhPQp++AOzUOoyaHYJi/2ESlBzB5Hwccm SsYQ== X-Gm-Message-State: AOAM532m7HKCd7Ho1WfQ5Mp088QESkgStrCXKRZbb5izax56+/m6yb8B 4Nj4gb7iyr95BZXTPKDAeXXIAI9uOfPzU7I2VEpm1jJpNfRtfmCc7ng7fZElsf0IfE0RZTl1oKI deJWezPJVTKE= X-Received: by 2002:a05:6e02:1a42:b0:2cb:eb85:4395 with SMTP id u2-20020a056e021a4200b002cbeb854395mr577693ilv.35.1649946102711; Thu, 14 Apr 2022 07:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySW9eFDl/20l+wYHt6KUUivHRwy3I3c9ZS4Vt8YHnsSsA7JdmygXiN3+pPwJ0aGkm91npruQ== X-Received: by 2002:a05:6e02:1a42:b0:2cb:eb85:4395 with SMTP id u2-20020a056e021a4200b002cbeb854395mr577685ilv.35.1649946102337; Thu, 14 Apr 2022 07:21:42 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id y17-20020a92d0d1000000b002ca8027016bsm1105558ila.45.2022.04.14.07.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 07:21:42 -0700 (PDT) Date: Thu, 14 Apr 2022 10:21:41 -0400 From: Peter Xu To: Alistair Popple Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: Remove stub for non_swap_entry() Message-ID: References: <20220413191147.66645-1-peterx@redhat.com> <87zgko9obm.fsf@nvdebian.thelocal> MIME-Version: 1.0 In-Reply-To: <87zgko9obm.fsf@nvdebian.thelocal> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: dfoeqhsudrh1jpumxg8ag3kapwjtoest Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aAoiDUkK; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf12.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: C2E4040008 X-HE-Tag: 1649946104-567500 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000642, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 14, 2022 at 03:48:33PM +1000, Alistair Popple wrote: > Peter Xu writes: > > > The stub for non_swap_entry() may not help much, because MAX_SWAPFILES has > > already contained all the information to decide whether a swap entry is > > real swap entry of pesudo ones (migrations, ...). > > > > There can be some performance influences on non_swap_entry() with below > > conditions all met: > > > > !CONFIG_MIGRATION && !CONFIG_MEMORY_FAILURE && !CONFIG_DEVICE_PRIVATE > > > > But that's definitely not the major config most machines will use, at the > > meantime it's already in a slow path of swap entry (being parsed from a > > swap pte), so IMHO it shouldn't be a major issue. Also according to the > > analysis from Alistair, somehow the stub didn't do the job right [1]. > > I wasn't so much concerned about execution speed given it's on the slow path > anyway but overall code size, which is one reason all those config options might > be disabled. However in practice it made little to no difference as those config > options already remove most of the extra code so I agree we can drop the stub. I see, yeah that's a good point. I'd wildly guess a minumum set of Linux build could still like that, but not strongly, as I'd first think about not having CONFIG_SWAP at all if so. > > Reviewed-by: Alistair Popple Thanks! -- Peter Xu