Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3379670ybt; Tue, 30 Jun 2020 00:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwqlmraEyZ9qO2euLZ2+aM/ys3xTSAFwdoH/QEBStI7O9KxOWcDpqtuhAIjspQKiaOC0Yt X-Received: by 2002:aa7:d9c7:: with SMTP id v7mr17353409eds.36.1593503975819; Tue, 30 Jun 2020 00:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593503975; cv=none; d=google.com; s=arc-20160816; b=iC9XAvnKv9zO8kChT7MLkygSOXCY2KXtASX8x0d9kWvkBe9AIZC6ijDi79TuuQDbxm tZ3YEJtzEz3nA30ddWKq+V54hEfBQOB9THizRth9hNgt25V6dXs7xTKuYP2dJIeLJAEa k19divLcH+53GK/Dct48TV4Jgxgbfb4MFFiR6Bef/wgHZwl/uhxhesEUg7WiFTe+TOQa lLzcXL30A+/iRfwHHrc919vN/X7IMRa3tABdyuTYbP5SFv6EeWWRTC9/22EQZndLBXVE vCoAdkOcwR8oEd3xjQNLOf6Ppn6zpxvYy5UOyDWxt++t/fS2lM33aMP07aPVbLWG8S4p u4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yEgSNSvBO7JS80R0g7L6v7cEOtvmMnbOhWUqmFKR918=; b=ePWySGvpQPCcrZVmA9xLiQqZFy96Ogt2vkno5/4G8co/Ndr9yLJ70HXFNLD1cfF4BP Rk/+TH9iOwtjgi0ni5KSEnlGgKaCvmf8at2QjIx8cqEg8Z99OHvzSiPfr8xfbkBmuEjS 60xePlptveG6kgJTI7XqwI6V12M0m6vTtDVc0kXmu0VvMGjZ632Y6Jcm8du9cn/pf/DR CjYLTgSgjrWX7QZlCnBgtNaY0md6TjiHs4y01JOJo7UjyD3pNXTgvm9BCj+kQoZPoQ/G yHq9UQ2r/OlPbH+ESc+r0PScGV/1xLimC7+rXSscuQW+By2ckp895Zjtav498i7hVAlF OeFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="VX0xWz/0"; 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 nb1si1225870ejb.565.2020.06.30.00.59.00; Tue, 30 Jun 2020 00:59:35 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="VX0xWz/0"; 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 S1731120AbgF3Huh (ORCPT + 99 others); Tue, 30 Jun 2020 03:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731033AbgF3Huh (ORCPT ); Tue, 30 Jun 2020 03:50:37 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DCDEC061755 for ; Tue, 30 Jun 2020 00:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yEgSNSvBO7JS80R0g7L6v7cEOtvmMnbOhWUqmFKR918=; b=VX0xWz/0ti0sq4TDRZf55a5Iq+ 0Ru8Ss1cQvLK1Fev5ESkkP16ne8mx5zoXdaYIBV0TNQdveZGj8aXJgVyDHMHh9QcSaFHdCvngzJ2q gdvXc+gcTDc8yhMXEc/K2Q4qO0BsLOU4lGwrgzl9V6dlKbMKBYxO/4Tx6+j3fLBudyLLgyDskKAwl Te/VpQ0EYY3Lm1Stw3l63u2s0rdSRqoSz2De1Ss6xtRFZl1oLLw0SU7Wy2CdVChJvg3zvUQFKD8Si 3YzRZ8tLMZqKvizpEh2R8031TYSrvPSb9lOnqcF/wsdayA/xfnxgIMQtkVWSAzRm+E93Dvf8muJIh 6xF3wnQQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqB2D-0001Gy-6D; Tue, 30 Jun 2020 07:50:29 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 05055302753; Tue, 30 Jun 2020 09:50:26 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BCB1123D58AC6; Tue, 30 Jun 2020 09:50:26 +0200 (CEST) Date: Tue, 30 Jun 2020 09:50:26 +0200 From: Peter Zijlstra To: Chen Ni Cc: mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel: events: use offset_in_page macro Message-ID: <20200630075026.GN4817@hirez.programming.kicks-ass.net> References: <20200630074258.8301-1-vulab@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200630074258.8301-1-vulab@iscas.ac.cn> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 30, 2020 at 07:42:58AM +0000, Chen Ni wrote: > Use offset_in_page macro instead of (addr & ~PAGE_MASK). Shees, so now we're replacing a trivial expression with something that's actually longer to type? How does that make sense? > - memcpy(dst, kaddr + (vaddr & ~PAGE_MASK), len); > + memcpy(dst, kaddr + offset_in_page(vaddr), len);