Received: by 10.223.176.5 with SMTP id f5csp2249067wra; Mon, 5 Feb 2018 00:25:49 -0800 (PST) X-Google-Smtp-Source: AH8x2240gjExbR/KS16w4XWo2oaGDvgDUbbKEO+BcsLuHiqo4Y6vl3My6kKgdGrMU/BKBqiC0/3m X-Received: by 2002:a17:902:6a89:: with SMTP id n9-v6mr42538761plk.212.1517819148991; Mon, 05 Feb 2018 00:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517819148; cv=none; d=google.com; s=arc-20160816; b=fbTOJa04t0fpcXnxnKqb3q8Mhze09aVxViq7GfmRFHp4wabzygWUm5e5RFHQz6//t0 wvBuEVpgV2TSUflJCz7db6ePZ9j38X8Ksy5wm8aSyBRnreBsDmy8rgxNc9BlDPekhlj5 POGGeXp51QleXyFsnJr5zenNXTUBsMN+Dy+udjsNrpZys60YOn0jDyrZN8kvJLjfhlaC 9JEG2ut9jQ0/wBt/vMFm08OdtAdtyOt965wMpVLRh7EznmwYbgkr06a31+pVlNQSA4Ip /P2gB5MvKwZ2VWd5Ybfer2DFLyjFSK3V5SZ80NSSl8cxdRCuJeFh7gUjy4/b2xRM8im9 NSiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=IMIcZqk8V7NC8wtwruYyBncKWYChcJXQ1YzReDFx4xE=; b=xw5hpDmvqrJSC8s5E+bkGWGPntg3j31aeMRprz1N4OoO0LwHG02AC6tbVhnfsW0GPm xVv2n0CNPz0fAOTOf5qRKxkVYTG7aiuwz1iAssZx50TDpMlZsw2kce7ncj+J7wCiyPtm Fdb7vkDaUsGstcdEwWgCvYGfl7wmx8FJCZ1GZZRNEITEDzeRTih/Tu0x0T5gxufNv5ZG 5njSHYbp+xZj22NZuGDPZegFSSkPob1SemgXL6C+cWcVrYUjkJ8K0LpN4FxvQ21NGvuo I54pzPz+bbj5zLXUvCvugkD1uYAOlsyBP1vEV/AmHTss6AZd0L9edRhjj/6HzVWLfPDC 3tqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si1905001pfa.52.2018.02.05.00.25.33; Mon, 05 Feb 2018 00:25:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbeBEIYx (ORCPT + 99 others); Mon, 5 Feb 2018 03:24:53 -0500 Received: from [210.13.100.6] ([210.13.100.6]:53612 "EHLO mail2012.asrmicro.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752510AbeBEIYf (ORCPT ); Mon, 5 Feb 2018 03:24:35 -0500 Received: from [10.1.50.16] (10.1.50.16) by mail2012.asrmicro.com (10.1.24.123) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 5 Feb 2018 16:24:33 +0800 Subject: Re: [PATCH] tick/broadcast: set next event of bc to KTIME_MAX To: "linux-kernel@vger.kernel.org" CC: , , , References: <1517540567-23599-1-git-send-email-qiaozhou@asrmicro.com> <201802051045.tkPgpDTw%fengguang.wu@intel.com> From: qiaozhou Message-ID: <40be5566-99d7-6d1a-610b-4c1849254fd0@asrmicro.com> Date: Mon, 5 Feb 2018 16:24:33 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802051045.tkPgpDTw%fengguang.wu@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.1.50.16] X-ClientProxiedBy: mail2012.asrmicro.com (10.1.24.123) To mail2012.asrmicro.com (10.1.24.123) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This patch needs refine and I'll check more. Thanks a lot. On 2018年02月05日 10:17, kbuild test robot wrote: > Hi Qiao, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on tip/timers/nohz] > [also build test ERROR on v4.15] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Qiao-Zhou/tick-broadcast-set-next-event-of-bc-to-KTIME_MAX/20180205-093126 > config: x86_64-randconfig-x017-201805 (attached as .config) > compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 > reproduce: > # save the attached .config to linux build tree > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > > kernel/time/tick-broadcast.c: In function 'tick_handle_oneshot_broadcast': >>> kernel/time/tick-broadcast.c:669:18: error: request for member 'tv64' in something not a structure or union > dev->next_event.tv64 = KTIME_MAX; > ^ > > vim +/tv64 +669 kernel/time/tick-broadcast.c > > 595 > 596 /* > 597 * Handle oneshot mode broadcasting > 598 */ > 599 static void tick_handle_oneshot_broadcast(struct clock_event_device *dev) > 600 { > 601 struct tick_device *td; > 602 ktime_t now, next_event; > 603 int cpu, next_cpu = 0; > 604 bool bc_local; > 605 > 606 raw_spin_lock(&tick_broadcast_lock); > 607 dev->next_event = KTIME_MAX; > 608 next_event = KTIME_MAX; > 609 cpumask_clear(tmpmask); > 610 now = ktime_get(); > 611 /* Find all expired events */ > 612 for_each_cpu(cpu, tick_broadcast_oneshot_mask) { > 613 td = &per_cpu(tick_cpu_device, cpu); > 614 if (td->evtdev->next_event <= now) { > 615 cpumask_set_cpu(cpu, tmpmask); > 616 /* > 617 * Mark the remote cpu in the pending mask, so > 618 * it can avoid reprogramming the cpu local > 619 * timer in tick_broadcast_oneshot_control(). > 620 */ > 621 cpumask_set_cpu(cpu, tick_broadcast_pending_mask); > 622 } else if (td->evtdev->next_event < next_event) { > 623 next_event = td->evtdev->next_event; > 624 next_cpu = cpu; > 625 } > 626 } > 627 > 628 /* > 629 * Remove the current cpu from the pending mask. The event is > 630 * delivered immediately in tick_do_broadcast() ! > 631 */ > 632 cpumask_clear_cpu(smp_processor_id(), tick_broadcast_pending_mask); > 633 > 634 /* Take care of enforced broadcast requests */ > 635 cpumask_or(tmpmask, tmpmask, tick_broadcast_force_mask); > 636 cpumask_clear(tick_broadcast_force_mask); > 637 > 638 /* > 639 * Sanity check. Catch the case where we try to broadcast to > 640 * offline cpus. > 641 */ > 642 if (WARN_ON_ONCE(!cpumask_subset(tmpmask, cpu_online_mask))) > 643 cpumask_and(tmpmask, tmpmask, cpu_online_mask); > 644 > 645 /* > 646 * Wakeup the cpus which have an expired event. > 647 */ > 648 bc_local = tick_do_broadcast(tmpmask); > 649 > 650 /* > 651 * Two reasons for reprogram: > 652 * > 653 * - The global event did not expire any CPU local > 654 * events. This happens in dyntick mode, as the maximum PIT > 655 * delta is quite small. > 656 * > 657 * - There are pending events on sleeping CPUs which were not > 658 * in the event mask > 659 */ > 660 if (next_event != KTIME_MAX) > 661 tick_broadcast_set_event(dev, next_cpu, next_event); > 662 else > 663 /* > 664 * not program broadcast timer, but set the value to show that > 665 * the next event is not set, which is used in > 666 * __tick_broadcast_oneshot_control in idle tick_broadcast > 667 * enter/exit control flow. > 668 */ > > 669 dev->next_event.tv64 = KTIME_MAX; > 670 > 671 raw_spin_unlock(&tick_broadcast_lock); > 672 > 673 if (bc_local) { > 674 td = this_cpu_ptr(&tick_cpu_device); > 675 td->evtdev->event_handler(td->evtdev); > 676 } > 677 } > 678 > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation >