Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1376311pxb; Mon, 11 Oct 2021 04:50:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE/zG6jxM+ZBMjtyR1BBxIqWcToojOv5KlfDPjL1gQdms7BKsE5ZEE3PVjKcwokZO302+1 X-Received: by 2002:a17:90a:bf91:: with SMTP id d17mr30310845pjs.158.1633953017879; Mon, 11 Oct 2021 04:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633953017; cv=none; d=google.com; s=arc-20160816; b=PpgZ5yN/CJ7RihhzCcn4rXQZECpJhWkjud0dnw3iHY9r5mTgTwaX9odsEhvY8bvr6o 2GAKwNlHJLyJ5lAiqlnMPZWVq0KcBXtNvlNoWMqAF3o8KZzl9RHnXteDCQm4v7vBzI4J Gn/AiyWfTPn/nHRAoX2aNAjhQhahBdFh6ieu5iSgqwtAsYJYMkdMUnLzdqCTO65w3Hdb JXgaxW8syHJC9aSyovpcUqRGW0zFZiIMOAjs67E14QVTVEgB5PznjcszLI6CWIDSSXSR xAAIrWyEI+ff0lk781cm2ORmocu6yUPKoczGhvokHZpGgbHzPqeku9xzcrcud1TNJY1M v7lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WmIH+gyLv1IEII2jV9ccpTyXH9cYgsrJ11N5wI46Cwk=; b=YxXT7HBpOnFzXjJ1e4Omn/me2RJdSDRTqtYa9Ib4lYfzqvrbPairM7E2sB7vcSjlSd djnwIrDGpgu7yG7UBibHJZDl80OH7GXLMO/QQ6CdFDP44oEuC3TOla1Dc5TX8sXVNdmn WOT41wawxU/5QJ+vKhSNwRC7eYr3D8h/LBSoKshd/vxpB+HJVu9X7ago12V5qSvzNyCR O658aYpk8SRbZ5vSoYONvKcsKBk3mDMZ4BUA+sIv0huR8EECtfRuDJqPJR3qWUST60zM HlJZs80uCBlIzNw+aAUUjgORCZbJ7WDTLoOcrMe1G7BR45z9SHlXClr15KTg8DrCIsTh WeVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XSShNGio; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w186si10620607pfw.135.2021.10.11.04.50.05; Mon, 11 Oct 2021 04:50:17 -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=@gmail.com header.s=20210112 header.b=XSShNGio; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234510AbhJKHeo (ORCPT + 99 others); Mon, 11 Oct 2021 03:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234502AbhJKHen (ORCPT ); Mon, 11 Oct 2021 03:34:43 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 154EEC061570 for ; Mon, 11 Oct 2021 00:32:44 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id np13so12589311pjb.4 for ; Mon, 11 Oct 2021 00:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WmIH+gyLv1IEII2jV9ccpTyXH9cYgsrJ11N5wI46Cwk=; b=XSShNGiojyLlUovr7IKaqfRGJpRi3a1nfwsAdlxge9m12kC+OTSVuy1GLR6B7pozzZ 2Rl6iMtuYWwkXbqErdqkCOJvgE8zZW/XFtcUZKKla8tOsX9oy/ysuNGtrIBm3LPm/3pj ljSQ4C42U4hH0U4gjFtNtkTqGLjSJwRigBLVFxv/19xbaoD3RShtJVW0p7gSvxgnLDCH 8G1/J3WaWfZzg4blcTzvQSK09T4S0dE44kil/HQRxDmBVrYquEjoCJ5Zn9o63MRSDq+H 5Eg4UMBXurLYyREnHl+Gk3MdPR2OuJOUg6yEOzOwMX4+vKeO6Z4gkSCoUoJ9TwGaD9fX dYWg== 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=WmIH+gyLv1IEII2jV9ccpTyXH9cYgsrJ11N5wI46Cwk=; b=oAQ4YyrRWk+x6KSYVKJ4T0kF1RzZVPAzP75fW+tIlF9ip7ldnE68Lm7OE5/ETc7D73 3ztFG0QOFcxsLQBNbldeAUSZApwOLrRUxq3VnuoNCdqBi/6XWahtc6iaOjw7wYU80vrN T6zmMuUjalgr5JIBCVMAFzP9MpmhAbLfFqJ+glXYW4hXOVT+d1j8Q3gT6HsEjbT6T9KU J103+i+vgLz0oBhv0drAkW4VBjC4I4ZIPKzuBCUsUl/20CgjOXBH8QHUqPbdGkYgSu30 clfKZ69mHLmSY+wskXCucb9/vG/wR9QqhLw3guG7d/EQdaNXCLsfMRIEhN2x7R8wJOb4 No5A== X-Gm-Message-State: AOAM532XlaARQ3wLwxsr6C1g2W8IDiDiiY8GJu7IjNa/Cjonl90d0Wc5 SQSsqIl9k12grps4wQs0Jjk= X-Received: by 2002:a17:90a:6b01:: with SMTP id v1mr29200238pjj.6.1633937563671; Mon, 11 Oct 2021 00:32:43 -0700 (PDT) Received: from kvm.asia-northeast3-a.c.our-ratio-313919.internal (24.151.64.34.bc.googleusercontent.com. [34.64.151.24]) by smtp.gmail.com with ESMTPSA id k13sm7207015pfc.197.2021.10.11.00.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 00:32:43 -0700 (PDT) Date: Mon, 11 Oct 2021 07:32:39 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Christoph Lameter Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka Subject: Re: [PATCH] mm, slub: Use prefetchw instead of prefetch Message-ID: <20211011073239.GA63896@kvm.asia-northeast3-a.c.our-ratio-313919.internal> References: <20211008133602.4963-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 11, 2021 at 09:20:36AM +0200, Christoph Lameter wrote: > On Fri, 8 Oct 2021, Hyeonggon Yoo wrote: > > > It's certain that an object will be not only read, but also > > written after allocation. > > get_freepointer is used in multiple code path not only in allocation. It > is for example used when scanning through a freelist. > > With this change all objects get needlessly dirtied and the cross cpu > cache contention is increased. I didn't touch get_freepointer and there's only one caller of prefetch_freepointer. My change was not adding additional prefetch on get_freepointer, but changing existing prefetch into prefetchw. The prefetch was introcued by commit 0ad9500e16fe ("slub: prefetch next freelist pointer in slab_alloc()") that you ACKed in 2011. Do you think removeing existing prefetch is better than changing it from prefetch to prefetchw?