Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp890114pxb; Wed, 27 Oct 2021 14:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvy7MFWun7E4V1SasuwFUh8MjihPgMN7dgCbKxWbVvtKOdEGTKgQNhMVjHAjeEW9DkXR4K X-Received: by 2002:a17:906:e2cf:: with SMTP id gr15mr110930ejb.49.1635370385616; Wed, 27 Oct 2021 14:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370385; cv=none; d=google.com; s=arc-20160816; b=Q6ZhUbwNd+9f20mG8tBF25Biuy03IEUVnBT0zHJiXvKyEVxHoA9xBHYDICAfgHhrZU bX7rmbGf/EHUWVIaDIMZRXTz1o9/RYrjP4/jBHUzwnbe2EsZ8QQ1D1KlX4HG5OSSKr+W nRE4/d7imw+Wkfgt5SzrfYQzxx4ekI/zPczLiFvpxYHYIMBmQ38Tq5qETI7b1OceFL5D cDWK2sE8KaYI/fP4pSEB6lljtht+qibdE533EeY9xFwGwoX2XeEmNNq/qFS3FtjjcStu Xs5IsZZ9G0LdPOOWpuTBV8HcVi7kYZwy9a4YlfUtz/Iqcs3XwktR1VTz8qmNdBlkJkzr /4Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jm/RSf4rCAITEo2BV23aNePeo8qwzmc9rjVyo//Sm2w=; b=vHWjerPL59mpk5TRWvxpwnY9IGEf0AvoeBjeLhafPxSn8y7CDgLBvBDkHPhv0C4ZNf DH338gOPJDANjVdl4eqWA2gG4lTSl/DlyGimqAyJD+tHn4y/eJsPjsxsp4hCrILGw5/6 qwbyGERKobG1em+13pXkFn9HYOAw/p8G7fukYz7L7Jk0wjc9f+6Q4fc+4Ht3SNAlXLBR +Zl5lmitlR4xgELpc7sm59WBDFFaavgBSGLcGnCjygPYCPH8+IotFDG5TDdyu/uqeYDR 5aqslGbQzY/LrgjKUdtTNOIICeM8y51YdjhED7kG5ARwsbk6iT85DCcDIDKxfKmdmDdg eyEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=DE53XnOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b17si1036365edh.335.2021.10.27.14.32.42; Wed, 27 Oct 2021 14:33:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=DE53XnOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238469AbhJ0S0H (ORCPT + 97 others); Wed, 27 Oct 2021 14:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236888AbhJ0S0E (ORCPT ); Wed, 27 Oct 2021 14:26:04 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE50C061570 for ; Wed, 27 Oct 2021 11:23:37 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id l13so8033990lfg.6 for ; Wed, 27 Oct 2021 11:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jm/RSf4rCAITEo2BV23aNePeo8qwzmc9rjVyo//Sm2w=; b=DE53XnOsp2UZoHcQaGjN87P4NcbSE8qj1rBVRDhKYNzC81Sy+TaGIz6zgbRDa/vuDJ KNWTN52x9VpgsgZRqOL49qcoT+nz81r0kHjinwiCaa6y+XsG7oaM0JEJJuqnooFAR5rx khuxM+qC3sGdFQGJ0MWfcvEMyCP8aVzIrasBq9RSYVlPsbVMAgYtQJKAQz8niwOYnkmU +q7PL8YBOW6lnqyHqFrFjcNLK/ZstGzw28n466sjq53t8f8HTWiQnObvcohU2V9fhCSA dvMuInKsZVBJ2FFVNuh2nesWSw4OQtn5G3i6ZPX3fLEMSpntmgamQnPW3jdgETvX10Np pNUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jm/RSf4rCAITEo2BV23aNePeo8qwzmc9rjVyo//Sm2w=; b=jDEI0b6Yrc37dTy2zRoWxne27exfihQY6SH1fiGkwhIXmpkMnzeJgqxjduoIhEwgtH WN+Wm4ugd1sxpsOZ+heDgc+ShE4OjcpU9QjW3/DrQwxFo/au78eN8OLk5uAYkJDfaRiT rvHFM9gKRnQOEqg+OAVLSdvUulVG1vAh7T89mjlgM++UJNEllvDr23mOV3vy5vOoq7/L f5G8wv/7nArxXpzfIsVerhFbMORqXgrTHdb4BdZwY4ytEPBB83yLLAQPEsxqjRLW0Q6c z2wco2CSYsbnyceBOjwT5IW797f1mLj06jSz7O9F2hJhBXzU3NgnF60NCIxnFLgabZaz QKGQ== X-Gm-Message-State: AOAM532sL2Hsjc7G/Y+G+rC11+dOcXO/vSeiH7x91rcsZRRvmp3H5ORO HNQukpeL2lRbcnl2LGrNOBPfQbrR/9aoqYFl69QMGA== X-Received: by 2002:a05:6512:1046:: with SMTP id c6mr12998783lfb.475.1635359016292; Wed, 27 Oct 2021 11:23:36 -0700 (PDT) MIME-Version: 1.0 References: <20211026173822.502506-1-pasha.tatashin@soleen.com> <20211026173822.502506-2-pasha.tatashin@soleen.com> In-Reply-To: From: Pasha Tatashin Date: Wed, 27 Oct 2021 14:22:58 -0400 Message-ID: Subject: Re: [RFC 1/8] mm: add overflow and underflow checks for page->_refcount To: Matthew Wilcox Cc: LKML , linux-mm , linux-m68k@lists.linux-m68k.org, Anshuman Khandual , Andrew Morton , william.kucharski@oracle.com, Mike Kravetz , Vlastimil Babka , Geert Uytterhoeven , schmitzmic@gmail.com, Steven Rostedt , Ingo Molnar , Johannes Weiner , Roman Gushchin , Muchun Song , weixugc@google.com, Greg Thelen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 11:05 PM Matthew Wilcox wrote: > > On Tue, Oct 26, 2021 at 09:21:29PM -0400, Pasha Tatashin wrote: > > I think we can do that by using: > > atomic_fetch_*() and check for overflow/underflow after operation. I > > will send the updated series soon. > > Please include performance measurements. You're adding code to some hot > paths. I will do boot performance tests to ensure we do not regress initializing "struct pages" on larger machines. Do you have a suggestion for another perf test? Thanks, Pasha